|
||||||||||||||||||||||
Date and Time : Adding TimeAdding Subtracting dates and times.. read the following examples to see where I'm heading with this.
Timezone ExampleSay we have a user in America, and another in Russia. They're both reading the same document. However, the time says 'Posted on December the 6th 2002, 11:33am'. Thing is, its only 5am in the morning for the American, and already 4pm in the afternoon for the Russian.. even tho the topic was just posted.The reason, quite obviously, is that these people are in different timezones. If this document was on a secure site, or at least a place where you had to sign in.. under member details you could have an option 'Time Zone'. timezone is a value of -12 -> 0 -> + 12. This timezone can then be used to offset the post time of the document for each individual. To do this, we need to add and subtract the times.
Using MySQL, the last edit date of the doucment is being returned as a UNIX Timestamp, and the timezone is being pulled out of the member database as an interger.
Using this function, you can deal with such a situation.
You'd call this function using:
A little note about whats going on;
The
Author: Markavian |
tutorial Pages
|
|||||||||||||||||||||