View Full Version : Setting a specific timezone's time to mysql instead of server's time
Psychoman
06-05-2004, 12:19 AM
Quick question
<input type=hidden name="date" value="<?php echo date("F dS, Y h:i:s A");?>">
allows me to place the server's time on mysql database, is there a way that I can change the time to a specific timezone instead off adding or substracting hours to make up for the diffrence?
Psychoman
06-05-2004, 01:14 AM
Well, I Found how to do it, and with diffrent time zones, so if anyone is interested in doing so, this is how
<?
echo "Original Time: ". date("h:i:s")."\n";
putenv("TZ=EST5EDT");
echo "New Time: ". date("h:i:s")."\n";
?>
that sets it to eastern time
other times I found where
//putenv("TZ=EST5EDT"); // Eastern Time
//putenv("TZ=AST9ADT"); // Alaskan Time
//putenv("TZ=PST8PDT"); // Pacific Time
//putenv("TZ=MST7MDT"); // Mountain Time
//putenv("TZ=CST6CDT"); // Central Time
//putenv("TZ=GMT0"); // Greenwich Mean Time
//putenv("TZ=UTC0"); // Universal Time Coordinated
personally since I want to keep track of these zones, I created a file that is called upon by the scrip and simply has
<?
putenv("TZ=EST5EDT");
//putenv("TZ=EST5EDT"); // Eastern Time
//putenv("TZ=AST9ADT"); // Alaskan Time
//putenv("TZ=PST8PDT"); // Pacific Time
//putenv("TZ=MST7MDT"); // Mountain Time
//putenv("TZ=CST6CDT"); // Central Time
//putenv("TZ=GMT0"); // Greenwich Mean Time
//putenv("TZ=UTC0"); // Universal Time Coordinated
?>
like that it dosent inform the user that it is being changed, exactly what i wanted :D
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.