From: Thomas Faller Subject: jscript: Date.parse: long date with '/' or '-' Message-Id: <553BB686.7040300@gmail.com> Date: Sat, 25 Apr 2015 17:45:10 +0200 This patch is refers to the bug: https://bugs.winehq.org/show_bug.cgi?id=31726 (JScript Date.parse doesn't work) I've implemented that dates like 1970/01/01 can be parsed. This format is not documented under https://msdn.microsoft.com/en-us/library/k4w173wk%28v=vs.84%29.aspx but its implemented in the internet explorer and in the windows script host. --- dlls/jscript/date.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dlls/jscript/date.c b/dlls/jscript/date.c index 5e5ef1c..5e80910 100644 --- a/dlls/jscript/date.c +++ b/dlls/jscript/date.c @@ -2132,7 +2132,7 @@ static inline HRESULT date_parse(jsstr_t *input_str, double *ret) { } } else if(parse[i]=='-' || parse[i]=='/') { - /* Short date */ + /* Short or long date */ if(set_day || set_month || set_year) break; set_day = TRUE; set_month = TRUE; @@ -2152,6 +2152,13 @@ static inline HRESULT date_parse(jsstr_t *input_str, double *ret) { if(parse[i]<'0' || parse[i]>'9') break; year = atoiW(&parse[i]); while(parse[i]>='0' && parse[i]<='9') i++; + + if(tmp >= 70){ + /* long date */ + month = day - 1; + day = year; + year = tmp; + } } else if(tmp<0) break; else if(tmp<70) {