dezkit Posted March 23, 2008 Share Posted March 23, 2008 F d Y H:i:s T how do i make so that it say the time in EST time not GMT? Link to comment https://forums.phpfreaks.com/topic/97454-date/ Share on other sites More sharing options...
soycharliente Posted March 23, 2008 Share Posted March 23, 2008 If you're using PHP 5, date_default_timezone_set() might help? Link to comment https://forums.phpfreaks.com/topic/97454-date/#findComment-498654 Share on other sites More sharing options...
soycharliente Posted March 23, 2008 Share Posted March 23, 2008 I'm sure there's an easier way, but also? <?php $hour = date("H"); $min = date("i"); $sec = date("s"); $month = date("F"); $day = date("d"); $year = date("Y"); $offset = -5; echo date("F d Y H:i:s T", mktime($hour+$offset,$min,$sec,$month,$day,$year)); ?> I know you can also do things, like ... <?php date("F d Y H:i:s T", strtotime("+1 day")); ?> Maybe try playing around with ... <?php date("F d Y H:i:s T", strtotime("-5 hour")); ?> I've never messed around with it before so I don't know. Just some other things to think about. Link to comment https://forums.phpfreaks.com/topic/97454-date/#findComment-498657 Share on other sites More sharing options...
dezkit Posted March 23, 2008 Author Share Posted March 23, 2008 :/ this is part of the code im using function tdatetime($ts){return date("F d, Y g:i A", $ts);} Link to comment https://forums.phpfreaks.com/topic/97454-date/#findComment-499044 Share on other sites More sharing options...
Barand Posted March 23, 2008 Share Posted March 23, 2008 then you could apply Charlie's suggestion <?php function tdatetime($ts) { return date("F d, Y g:i A", strtotime('-5 hours', $ts)); } Link to comment https://forums.phpfreaks.com/topic/97454-date/#findComment-499064 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.