PHP time() function returning random time shift of an hour

Ranvaptantors

New Member
I have some PHP code that inserts a date into a table:\[code\]INSERT INTO tblEventLog VALUES ... date("Y-m-d H:i:s",time()) ...\[/code\]The results of this are usually correct, but the occasional date is an hour behind:\[code\]315070 05-Sep-10 18:08315069 05-Sep-10 18:07315068 05-Sep-10 18:07315067 05-Sep-10 18:06315066 05-Sep-10 18:06315065 05-Sep-10 17:04315064 05-Sep-10 18:01\[/code\]What could be causing this? There is only a single server.EDIT:
Using NOW() Worked!
The problem was that one of the PHP pages was changing the timezone (when creating a RSS feed) and the PHP time() function was picking that up. Using the database to set the time fixed things.
 
Back
Top