Jump to content

Question about date() function


Corona4456

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.
Link to comment
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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.