Jump to content

PHP Schedule


Risakval

Recommended Posts

Hello:

 

I am trying to get a schedule to work on our site.  We enter the schedules in admin in EST.  When a visitor comes to the site the schedule shows in his/her time zone.  It works perfectly.  Except...if a show on the schedule starts at 12AM Friday EST it should display 9:00PM Thursday PST.  Instead it shows 9PM Friday PST.  In other words the time is rolling back but not the day.

 

I know it is difficult without looking at the code...but here is the page: http://risaradio.com/index.php/risaradio-schedule.  Maybe someone out there has done this before and has a solution.

 

Thank you!!!

Link to comment
Share on other sites

try using just a time stamp of secs and then converting the time just before you output to the display forcing PHP to handle the conversion.

 

$MyTimeStamp = time();
$UserTimeZone = "America/Denver";

date_default_timezone_set($UserTimeZone);

$Time_Day = Date("H:i:s Y-m-d", $MyTimeStamp);

echo($Time_Day);

 

i actually just had done something like this.. where I needed the time to be changed based on the clients timezone.. so I had to write a Javascript function to find that timezone automatically and pass it to PHP incognito style.

Link to comment
Share on other sites

try using just a time stamp of secs and then converting the time just before you output to the display forcing PHP to handle the conversion.

 

$MyTimeStamp = time();
$UserTimeZone = "America/Denver";

date_default_timezone_set($UserTimeZone);

$Time_Day = Date("H:i:s Y-m-d", $MyTimeStamp);

echo($Time_Day);

 

i actually just had done something like this.. where I needed the time to be changed based on the clients timezone.. so I had to write a Javascript function to find that timezone automatically and pass it to PHP incognito style.

 

Thank you I appreciate your assistance.  I think with what you have it will still not change the day.  The time yes.  Again, 12AM Thurs is 9PM Wednesday...and it will not make the day conversion....it changes the time to 9PM Thursday  which of course is not correct. :).

Link to comment
Share on other sites

it should do exactly what your wanting.. time Returns the current time measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT).

 

 

if you are changing the default time zone before using the date() function then it should be fine.

 

did you test it?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.