Entry
How can I check if the server uses mm/dd/yyyy or dd/mm/yyyy for solution on American and British sys
Jun 14th, 2002 01:46
russel lindsay, Gareth Hay, Jean-Bernard Valentaten,
You don't really need to do so if you're using the Date() Object.
This Object has methods that allow you to extract the month, day etc.
without needing to worry about the locales.
HTH
But I *do* really need to do this. The server is supplying data as a
string, but there are 2 servers, one American and one British, and each
supply the dates differently. I need to find out which way it is.
Gaz
this is just theory - i haven't tested it...
if you know the format of the server's date, then you can create a new
date object - d = new Date(dateString). Then use this object to create
a new date string in the same format as the server. then you could
compare the strings, if they match, the date was american, otherwise it
is british.
rus