TDateTimeStamp Class
TDateTimeStamp Class is adpated from the ADOdb Date Library, part of the ADOdb abstraction library Download: http://phplens.com/phpeverywhere/
http://phplens.com/phpeverywhere/adodb_date_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 library overcomes these limitations by replacing the native function's signed integers (normally 32-bits) with PHP floating point numbers (normally 64-bits).
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 2 => 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 getTimeStamp.
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.
Located in /Util/TDateTimeStamp.php (line 66)
Fix 2-digit years. Works for any century.
Assumes that if 2-digit is more than 30 years in future, then previous century.
Gets day of week, 0 = Sunday,... 6=Saturday.
Algorithm from PEAR::Date_Calc
Not a very fast algorithm - O(n) operation. Could be optimized to O(1).
Checks for leap year, returns true if it is. No 2-digit year check. Also handles julian calendar correctly.
Low-level function that returns the getdate() array. We have a special $fast flag, which if set to true, will return fewer array values, and is much faster as it does not calculate dow, etc.
Documentation generated on Mon, 21 Apr 2008 11:34:49 -0400 by phpDocumentor 1.3.0RC4