JRS: In article <41**********************@news.easynet.co.uk>, dated
Fri, 30 Jul 2004 13:04:17, seen in news:comp.lang.javascript, Trev@Work
<no.email@please.?> posted :
Is there a way to format a date to the current user's country settings?
The date I post from the Date() function (Mozilla/JavaScript) is
incomprehensible by the back-end application (ASP/VBScript).
Methods toString & toLocaleString may do it.
The settings accepted by the back end, if in some way national, do not
necessarily include all of those that the front-end users may have
selected.
There is known to be one American, for example, who uses YYYY-MM-DD;
there may be others who comply with FIPS, their Federal Standard.
If your back end can receive a time_t, then that might be the best to
use, since javascript holds date/time in that form - if D is the Date
Object, just send D.getTime() . The present value is a little under
1091232000.
Ideal standards include YYYYMMDDhhmmss & YYYY-MM-DDThh:mm:ss ;
YYYY/MM/DD hh:mm:ss might be acceptable.
Consider carefully the effects of your local offset from GMT or UTC.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.