cluce Posted August 22, 2007 Share Posted August 22, 2007 Can someone please tell me how to alter this to display in CST time. I looked in the manual but it is not clear on how to do this. I know its not hard. I just never did it before. this is what I have.... echo date("F j, Y, g:i a"); //(ex.)March 10, 2001, 5:16 pm Link to comment https://forums.phpfreaks.com/topic/66162-solved-simple-php-syntax-question-on-time-format/ Share on other sites More sharing options...
Barand Posted August 22, 2007 Share Posted August 22, 2007 You could try something like $timeDiff = 1; // time diff between server time and CST echo date("F j, Y, g:i a", strtotime("-$timeDiff hours")); Link to comment https://forums.phpfreaks.com/topic/66162-solved-simple-php-syntax-question-on-time-format/#findComment-331371 Share on other sites More sharing options...
cluce Posted August 23, 2007 Author Share Posted August 23, 2007 thanks. I also found another way to... I can use this putenv("TZ=US/Central"); Link to comment https://forums.phpfreaks.com/topic/66162-solved-simple-php-syntax-question-on-time-format/#findComment-331917 Share on other sites More sharing options...
cluce Posted August 23, 2007 Author Share Posted August 23, 2007 here is the mysql way to change the timezone DATE_ADD(NOW(), INTERVAL 2 HOUR) Link to comment https://forums.phpfreaks.com/topic/66162-solved-simple-php-syntax-question-on-time-format/#findComment-332209 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.