The last time i try to attempt this problem, i get rid of the detail of the system calls from PHP to OS. i worked with datetime in a MySQL server which supports 1000-01-01 to 9999-12-31 and whole lots of datetime manipulation functions there. I wanna know how if it's solely on PHP and the local OS.
Apart from system calls from PHP, what i can think of in programming aspect is a simple mapping. Basically, days r running in a 4 year cycle. Thus, it's not difficult to just count on the year and map the datetime to a corresponding pt within 1970 and 2037...
what's left is to count on the exception... that's no leap year every 100 years(just as ordinary years) but leap year again every 400 years....
btw, it's very lucky that 2000 is the every 400 year exception...
Anyway, I wanna know how ppl usually do it, too.
$Spud->Regards();
Main Topics
Browse All Topics





by: us111Posted on 2001-05-25 at 05:27:21ID: 6120829
for sure, unix time starts in 1970 in will end in 2037 (unix bug)
I'm interesting to know....