I have some XML data which contains a date in dd/mm/yyyy format (ie UK date format).
In javascript I need to read this date then calculate the age (in days& decimals) of the XML data.
I can get today's date in milliseconds:
Expand|Select|Wrap|Line Numbers
- var current_date = new Date();
- var date1_ms = current_date.getTime();
Expand|Select|Wrap|Line Numbers
- var date2 = Date.parseString(docdate,"d/M/yyyy");
- var date2_ms = date2.getTime();
var date2=Date/parse(docdate."d/M/yyyy")
ignores my format command and reads the date as US format.
Can any one give me the correct line oif code, or a better one:-) or point me to a reference. Everything I;ve found formats the date for OUTPUT rather than INPUT.
Thanks.