On Mon, 1 Jul 2002, Peter J. Schoenster wrote: > On 30 Jun 2002 at 22:31, Timothy J. Luoma wrote: > > > I am trying to compare a given date string (i.e. June 30, 2002 is > > 20020630). I want to make sure that the input string that is given is > > not greater than today (i.e. if today is June 30, and you ask for > > 20020701, I want to be able to throw an error). > > I would question why you accept input as a particular format. It's > certainly easier to work with timestamps than arbitrary representations > of dates. I would not be so quick to assume you have to accept input as > is. Or at least have it fixed to a format ... but the Perl modules I've > worked with are liberal with what they receive .... :) Anyhow, I'd just > find a PHP module ot handle this.
In general, the user shouldn't ever have to format the date... it's all automatically generated. However, wise users will look at http://www.tntluoma.com/ethan/daily/index.php?20020701 and realize that they could possibly "look ahead" by manually editing the URL and going to http://www.tntluoma.com/ethan/daily/index.php?20020702 That's all I wanted to avoid. I'm using that particular date string because it works easily with what I am trying to accomplish. I am surprised, however, that two PHP functions would deal differently with the way that day#-of-the-year is handled (365 vs 366). Thanks to all who made suggestions on/off list, I believe I now have it working. TjL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php