Re: Date Format
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: Date Format

From: Dr John Stockton <jrs@merlyn.demon.co.uk>
Date: Fri Mar 31 2006 - 15:06:30 CEST

JRS: In article <TkhsYPLTPDLEFwjf@jgharris.demon.co.uk>, dated Thu, 30
Mar 2006 20:38:59 remote, seen in news:comp.lang.javascript, John G
Harris <john@nospam.demon.co.uk> posted :
>In article <MSHfoPGffaKEFw63@merlyn.demon.co.uk>, Dr John Stockton
><jrs@merlyn.demon.co.uk> writes
>>JRS: In article <Xns9794710F3FD12centroidincearthlink@207.69.189.191>,
>>dated Tue, 28 Mar 2006 16:06:50 remote, seen in
>>news:comp.lang.javascript, Bob Sanderson <sandman@LUVSPAMsandmansoftware.
>>com> posted :
>
> <snip>
>>>The output format I'm looking for is YYYY-MM-DD (no time).
>>
>>You should be requiring leading zeroes there, of course;
> <snip>
>
>This is also user-hostile, of course.

I don't see your point. Is the user the OP, or those who read his
pages?

He asks for output YYYY-MM-DD (which is as per ISO 8601); but it's not
clear whether he positively wants fixed-width fields. His existing code
does not give leading zeroes, nor does that of web_dev.

Requiring leading zeroes on input would be another matter. Requiring it
of /hoi polloi/ may confuse the innumerate - the concept of zero as a
digit was fairly new to the west when Columbus sailed - but requiring it
of intelligent or practised users is a precaution against errors such as
an inadequately-depressed key.

The set of acceptable input formats needs to include the set of output
formats, but may be larger. That requites careful thought if the
applicable localisation may vary.
 

-- 
© John Stockton, Surrey, UK.  ???@merlyn.demon.co.uk   Turnpike v4.00   MIME. ©
 Web  <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
     Check boilerplate spelling -- error is a public sign of incompetence.
    Never fully trust an article from a poster who gives no full real name.
Received on Mon May 1 04:34:06 2006