Forum Moderators: coopster

Message Too Old, No Replies

Convert Greenwich Mean Time (GMT) to Central Standard Time (CST)

Daylight Savings Time is Observed

         

drake77

2:41 pm on Mar 7, 2007 (gmt 0)

10+ Year Member



Hi, the server that hosts my PHP pages has its clock set to Greenwich Mean Time (GMT timezone 0). I need for my PHP scripts to have access to my local time which is Central Standard Time in the U.S. (CST timezone -6). Note: daylight savings time _is_ observed in my state. I have looked all over a PHP algorithm that would convert GMT to CST but have so far not been successful. Does anyone have such an algorithm lying around that they could post?

Thanks in advance.

Karl

jatar_k

3:49 pm on Mar 7, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld drake77,

if you use PHP > 5.1.0 you could use
[php.net...]

there are some notes on that page for other options as well.

drake77

3:57 pm on Mar 7, 2007 (gmt 0)

10+ Year Member



Thank you for the reply. It looks like the webserver is running PHP version 4.3.11

jatar_k

4:10 pm on Mar 7, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



the bottom of the link above says

See the user contributed notes for the putenv function for a workaround for previous versions of PHP.

so
[php.net...]
search the page for timezone