johntp Posted March 23, 2008 Share Posted March 23, 2008 Hey guys, I'm trying to use this script: <? echo date("D, F d, Y g:ia" ,time()); ?> The problem is that my webserver php.ini is set to GMT, whereas I am GMT -5, and cannot change the php.ini folder. Is there something i can add on to it to make it subtract 5 hours? Link to comment https://forums.phpfreaks.com/topic/97524-php-datetime-to-be-gmt-5/ Share on other sites More sharing options...
alin19 Posted March 23, 2008 Share Posted March 23, 2008 i don't know if this work but you can try it <?php $x=time(); $y=$x-(5*3600); echo date("D, F d, Y g:ia" ,$y); ?> Link to comment https://forums.phpfreaks.com/topic/97524-php-datetime-to-be-gmt-5/#findComment-498981 Share on other sites More sharing options...
johntp Posted March 23, 2008 Author Share Posted March 23, 2008 Yep, it worked like a charm. Thanks man your a life saver. Link to comment https://forums.phpfreaks.com/topic/97524-php-datetime-to-be-gmt-5/#findComment-498984 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.