Basic handling of pre 1901 dates

From: Date: Tue, 13 Nov 2001 18:52:22 +0000
Subject: Basic handling of pre 1901 dates
Groups: php.general 
Request: Send a blank email to php-general+get-74476@lists.php.net to get a copy of this message
I'm feeling dumb! The Basic Problem ================= Basically all I want to do is to output each day in turn from 1900 i.e. 01-Jan-1900 02-Jan-1900 03-Jan-1900 etc. But date() won't accept dates pre 13-Dec-1901 and mktime doesn't like anything pre 01-Jan-1970. I know I can get mysql to do this without trouble but not efficiently. So how do you work with pre-1901 dates in php? The Full Problem ================ In actual fact what I'm trying to do is list all dates within a given range which are NOT in a mysql table. The dates and date ranges can span anywhere from 1850 to the present. I can very easily use mysql to generate an array of the days which are present in the table. What I can't seem to do is get php to run through each day in turn and let me output it. The only possible solution I can think of is to just generate a dummy mysql table with all dates I might ever use and then join that to my actual date table and select the non-matches. Not a very elegant solution! What have I missed? George

« previous php.general (#74476) next »