Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UNIX_TIMESTAMP()

Status
Not open for further replies.

DeepBlerg

Technical User
Joined
Jan 13, 2001
Messages
224
Location
AU
Hi,

I have a timestamp field and the date & time appear fine in it through phpMyAdmin, however when I do a SELECT UNIX_TIMESTAMP(field), it returns a unix timestamp for me to use in PHP but it is in the future.

Any ideas why or how I can fix this?
 
How far in the future?

A couple of minutes? Make sure that the clock on the MySQL server and the PHP server are synched.

Whole hour increments? Make sure the servers' clocks are set to the same time zone?

Want the best answers? Ask the best questions: TANSTAAFL!!
 
Hi sleipnir,

It is in the future by a considerable time - about 6 or 7 hours, also the timezones are different, I was not aware that MySQL had its own clock, I thought it just used system time. Do you know how to set the MySQL clock in Linux?

Thanks.
 
Don't worry I fixed it, mysql server just needed a restart, after I had set the system timezone, mysql was still set on the previous time zone.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top