Re: Another date exercise
| From: | tedd | Date: | Mon, 17 Aug 2009 15:04:13 +0000 |
| Subject: | Re: Another date exercise | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-296884@lists.php.net to get a copy of this message | ||
At 4:22 PM -0400 8/16/09, Paul M Foster wrote:
On Sun, Aug 16, 2009 at 08:36:17AM +0100, Lester Caine wrote: -snip- But as has been said, the real solution is a date picker. I *hate* date pickers. They slow down input. I can type 082309<Enter> faster than I can ever do it with a date picker. The date class knows I'm in America and since it's a six-digit date, it must be mmddyy. (Yes, for those of you *not* in America, I agree our dates are goofy. I think we all ought to be on the metic system, too, but America and the UK seem intent on sticking to Imperial measure.) PaulPaul: Yes, that's part of the problem. I was suggesting an exercise where people could put their collective heads together and create a php solution. I realize that US has DD, MM, YYYY and the Euros have YYYY, MM, DD and others have other things (i.e., Year of the York). Not addressing the "other things" -- to me, if one uses a character for a month, then there's no problem in deciphering any entry regardless of format. For example, 2009 Aug 23, or Aug 23 2009, or Aug 2009 23, or 23 2009 Aug, -- they could all be entered in whatever order you want and deciphered correctly. The rules of course are: Year must be in thousands -- 1000-5000. Month must be a character -- D for December, May for May, Jun for June and so on. Day must be in ones or tens -- 1 or 09, or 31. It's certainly not a problem to write such code, I only suggested the exercise to get people to expound on the problems they encountered. Instead, I received "use javascript". Okay... but that's not a php solution, right? Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com