/    Sign up×
Community /Pin to ProfileBookmark

Display div box depending on server day & time

Basically Im developing an online radio website on wordpress.
We have a schedule of DJ’s that have bi-hourly slots between 2pm and 3am, then its just re-runs of old shows between 3am – 2pm.

A nice feature would be to display, lets say in the header or somewhere else, a small image of the DJ, along with a little bit of information of the show during his slot.

As we get listeners from all over the world, we will need to get the time from the server but the server is based in the US, while we are based in the UK but I know a few extra lines will overcome this obstacle.

The biggest problem is that I have 0 knowledge of PHP (hence why im using wordpress to develop this site) so I will be willing to pay $15 for someone to simply write me the code aswell as the best way to implement it ie. in hidden div boxes or whatnot.

If you’re up for it, get at me on here or on my email stylishjm[at]hotmail[dot]com

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@stylishjmauthorFeb 08.2011 — Anyone? Ill up the pay to $25
Copy linkTweet thisAlerts:
@Jarrod1937Feb 08.2011 — You can simply use strtotime(), which will pull its time from the current time on the server. From there its as easy as knowing how far off your servers time is from your time zone and then compensating for it:

strtotime("+3 hours");

If your time zone is 3 hours ahead, that'll give the correct time. Now, that will output the correct time, but in unix epoch timestamp format, to format it how you want you can simply pass it through date(), using whatever parameters give the needed output:

http://php.net/manual/en/function.date.php

As for how to implement it, unless you have some specific reason to, i wouldn't use hidden divs. You can simply have code that conditionally outputs the div contents itself, assuming you're not doing some sort of page caching. Though this type of thing can be hard coded, it would be best if you did it through a database implementation.
Copy linkTweet thisAlerts:
@stylishjmauthorFeb 08.2011 — Thanks. But still I have no idea on how to do this as I have little experience with coding, which is why Im willing to pay to get it done for me.
Copy linkTweet thisAlerts:
@grgnlsnMar 28.2013 — I would recommend tweaky.com to get quick additions like this to your Wordpress site. You can set a small scope for a project and a developer there will charge in $39 increments to complete the task. (Something like this I am thinking would only be the minimum $39) This has been a lifesaver for me on a few coding issues like this that are over my head.
×

Success!

Help @stylishjm spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...