|
//May-03-09 12:15:00 PDT
1.replace the regex expression:
var foo = str.match(/(\S\S\S)-(\d\d)-(\d\d)(\s+|\s+at\s+)(\d\d:\d\d:\d\d)\s+PST/);
to:
var foo = str.match(/(\S\S\S)-(\d\d)-(\d\d)(\s+|\s+at\s+)(\d\d:\d\d:\d\d)\s+(PDT|PST)/);
//May 03 2009 12:15:00 PDT
2.replace the Date constructor:
var d = new Date(foo[1] + ' ' + foo[2] + ' 20' + foo[3] + ' ' + foo[5] + " PST");
to:
var d = new Date(foo[1] + ' ' + foo[2] + ' 20' + foo[3] + ' ' + foo[5] + " " + foo[6]);
//Mon May 04 2009 03:15:00 GMT+0800
3.replace this:
var tzinfo = d.toString().match(/\((\S+)\)/);
to:
var tzinfo = d.toString().match(/(\S\S\S\+\d\d\d\d)/);
now it works for me ...
cheers
|