Page 1 of 1

Date() function showing the wrong time.

Posted: Tue May 24, 2011 2:12 pm
by Temor
So, my server is being hosted in a different timezone ( 2 hours difference ) and I use the date() function to insert the time into a database for a blog, but it shows the servers current time, and that tends to be quite irritating... Is there any way to insert MY current time into the database instead of the servers?

:)

Re: Date() function showing the wrong time.

Posted: Tue May 24, 2011 2:35 pm
by jacek
You can set the timezone with date_default_timezone_set(), for a list see http://www.php.net/manual/en/timezones.php

Re: Date() function showing the wrong time.

Posted: Tue May 24, 2011 3:42 pm
by Temor
jacek wrote:You can set the timezone with date_default_timezone_set(), for a list see http://www.php.net/manual/en/timezones.php
alright, thank you :)