Re: Non American strtotime

From: Date: Fri, 16 Jan 2004 15:12:53 +0000
Subject: Re: Non American strtotime
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-174816@lists.php.net to get a copy of this message
John W. Holmes wrote:
Tom wrote:
The end user gets to chose their date format, and so if I cannot reverse their arbitrary date format into a timestamp then I have no chance of ensuring that dates are correct. This seems like a really fundamentally bad thing about PHP :(
Seems like a fundamental flaw in your program. If the user enteres 01/02/03, what date is that? 2003? January? February? 1st or 2nd?
February. 1st. It's assumed in his environment that the format is dd/mm/yy, just like it's probably assumed in your environment that it's mm/dd/yy (I presume that based on your time zone). If you're developing for an intranet for instance, then you can work with such assumptions. What I find upsetting in Tom's attitude is his generosity in harsh words: "a really fundamentally bad thing about PHP" would be not being able to cope with this problem at all, but let's be serious, writing a short function (as previously exemplified for free via e-mail by third-parties) is not /such/ a big deal. It may be just me, but I never considered copy/pasting such a nauseating experience. My 2c, Bogdan

« previous php.general (#174816) next »