Jump to content

Archived

This topic is now archived and is closed to further replies.

Corona4456

Question about date() function

Recommended Posts

I searched around for an answer but I wasn't able to find one so if you can point me to a solution that would be great or if you can solve this problem then that would be great too. Ok, here is my problem. Well first thing is first here are the webserver specs:
Windows XP Professional w/ SP2
PHP 5.1.2
MySQL 5.0.18
Apache 2.0.55

Now on to the problem. I'm trying to use the date function. and when I do:
[code]
<?php
  echo date("Y-m-d H:i:s T I");
?>
[/code]
I get an hour time difference from my server. My server is set to use DST but ever since the time change in April occured the PHP date function has been returning the time 1 hour behind. For example, when I run it I get:
2006-05-03 23:37:31 MST 0
When I expect:
2006-05-04 0:37:31 MDT 1

It's not a HUGE problem but something I would definitely like to get fixed (if possible). I've tried setting the time zone by editing the php.ini file but it didn't seem to do anything. So if anyone has a solution to this problem or if you need more info please let me know. Thanks in advance.

Share this post


Link to post
Share on other sites
[code]<?php
  echo date("Y-m-d H:i:s T I", time() + 60*60));
?>[/code]

60*60 = 1 hour

more further explanation can be found at php.net --> [a href=\"http://www.php.net/manual/en/function.time.php\" target=\"_blank\"]here[/a]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.