date/timezone problem
Posted: Tue Oct 17, 2006 9:23 am
I have a problem with dates and timezones. I use this code to get the current date and time:
I'm in FL, which is EST (or UTC -6).
If I run my code at 10:12am I get this output:
Tuesday, 2006 October 17 07:12:01 MST -0700 0
Questions:
Why am I getting MST time?
How do I get EST time regardless where the user is?
My goal would be to save all times used by my database in EST, then depending on user's selected timezone (saved in db) recalculate it for displaying.
Basically my main concern is getting the time in EST, the rest I'll probably be able to do.
Maybe a hint/tutorial about changing stored time to different timezone.
Thanks.
Code: Select all
$date = date("l, Y F j, H:i:s T O I");
echo $date;If I run my code at 10:12am I get this output:
Tuesday, 2006 October 17 07:12:01 MST -0700 0
Questions:
Why am I getting MST time?
How do I get EST time regardless where the user is?
My goal would be to save all times used by my database in EST, then depending on user's selected timezone (saved in db) recalculate it for displaying.
Basically my main concern is getting the time in EST, the rest I'll probably be able to do.
Maybe a hint/tutorial about changing stored time to different timezone.
Thanks.