MySQL Forums
Forum List  »  General

Timezone problems
Posted by: Roy Hazan
Date: November 23, 2004 03:55AM

Dear all, I have taken on a website using mysql and php.
I have discovered many problems with loading and saving dates.
I am coding using mysql 4.0.13 running on a US timezone, but the website is for the UK.
So, when I save or load dates, they ar always 7/8 hours behind.

I used the function from_unixtime() to return a date that PHP could read.
I used the function unix_timestamp() to save a date from PHP format.
I did this to overcome the timezone differences.

However, any dates before Jan 1 1970 come up as Jan 1 1970 in PHP.
I also need to distinguish between fixed dates such as the date of birth and time-dependent dates such as a due date.

Has anyone any ideas on how I can get round these issues?

Would it be better to write a custom PHP routine to convert between timezones or is there a better way to handle this issue?

Any ideas would be really helpful.

Options: ReplyQuote


Subject
Written By
Posted
Timezone problems
November 23, 2004 03:55AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.