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

PHPEverywhere:
Back to the Future in PHP
Jan 27, 2003 @ 13:16:01

So, working with PHP's date functions, and happily coding along, when all of a sudden, you discover a timestamp that just doesn't look right. You think it should represent January 1st, 1869, but it doesn't look low enough. Well, there's a reason - PHP can't handle dates in that range because the two major OSes that it runs on can't either (*nix and Windows)! So, what's a coder to do when they really, really need a date from that time period? Well, PHPeverywhere might just have an answer...

With their ADOdb Date and Time Library, dates from 100 A.D. to 3000 A.D. and later have been tested. The minimum is 100 A.D. as <100 will invoke the automatic 2-digit => 4-digit year conversion. The maximum is billions of years in the future, but this is a theoretical limit as the computation of that year would take too long with the current implementation of adodb_mktime( ).

It's a pretty good set of functions for those needing dates back in that time (or forward in time), and the best part? You don't have to use the ADOdb package to be able to use it - you can download it as a standalone part of the entire DB library...

tagged:

Link:


Trending Topics: