Date formatting

T

Trev@Work

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).
 
G

Grant Wagner

Trev@Work said:
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).

Use a date format both the client and the server are sure not to
misinterpret:

YYYYMMDD[HH[MM[SS]]]
 
D

Dr John Stockton

JRS: In article <[email protected]>, dated
Fri, 30 Jul 2004 13:04:17, seen in Trev@Work
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top