Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPBuilder.com:
Making Up Some Time
Sep 12, 2003 @ 12:33:47

If you've messed much with the date/time functionality of PHP, you know that it can be quite frustrating to work with anything but the local server's time. Well, this new article from PHPBuilder.com hopes to alleviate some of the pain this causes.

In On User-Defined Timezones in PHP, the two authors work to explain how they came to understand and use custom, user-defined timezones in their application at Commnav.com. By allowing the user to specify a timezone, we unwittingly opened a Pandora's Box, out of which flew shrieking timestamp demons who tormented us, and drove us to the brink of insanity. They go on to explain how they coded this function (new_mktime) to generate timestamps based on an offset for each user, and allowed them to manipulate these timestamps quickly and easily.

Overall, this is a pretty good read, and could be quite useful for a lot of people out there - especially those that host in another country than they live. (Note: at the time of this writing, the images in this article were broken links.)

tagged:

Link:


Trending Topics: