Download: http://php.weblogs.com/adodb_date_time_library

PHP native date functions use integer timestamps for computations.
Because of this, dates are restricted to the years 1901-2038 on Unix
and 1970-2038 on Windows due to integer overflow for dates
beyond those years.

This has been frustrating for me, so i developed this library to overcome
these limitation by replacing the native function's signed integers
(normally
32-bits) with PHP floating point numbers (normally 64-bits) when
necessary. This library supports dates from 100 A.D. to billions of years in
the future.

It also fixes the problem of negative timestamps (pre-1970)  not supported
on Windows.

To use, simply replace

 getdate()  with  adodb_getdate()
 date()     with  adodb_date()
 gmdate()   with  adodb_gmdate()
 mktime()   with  adodb_mktime()
 gmmktime() with  adodb_gmmktime()

This library is available as a standalone PHP file, and you do not have
to use the ADOdb database abstraction classes if you do not want to.

Performance

For high speed, this library uses the native date functions where possible,
and only switches to PHP code when the dates fall outside the 32-bit signed
integer range.

Quality Assurance

For QA, several thousand dates were randomly generated and the results
of the adodb_* date functions were compared with the native PHP versions.
Years between 100 A.D. and 3000 A.D were also tested. The code is
Y2K compliant





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to