eBay timezone fix

By Steinar H. Gunderson Last update Jan 23, 2007 — Installed 2,732 times.

fixed for me

in
Subscribe to fixed for me 1 post, 1 voice

ynzheng Scriptwright

//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

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel