eBay timezone fix

By Steinar H. Gunderson Last update Jan 23, 2007 — Installed 2,062 times. Daily Installs: 0, 1, 2, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 2, 3, 1, 1, 0, 1, 1, 1, 2, 2, 2, 1, 2, 0, 2, 3, 0, 0, 2

Archived Comments (locked)

Subscribe to Archived Comments 8 posts, 7 voices

Jesse Andrews Admin

The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008)

 
thewolrab User

You know, I always wondered why eBay never provided the option to select your timezone. Quite an obvious thing to do really.

Thank you =]

 
Jeremiah Jones User

I feel for Tommy, really.

Thanks so much for a great script. I appreciate the addons, too.

 
bestfacts User

There's a new firefox addon (myTimeZone for eBay) which works for any time zone and automatically adjusts for DST:

https://addons.update.mozilla.org/en-US/firefox...

 
Jacob Ford User

This is a great idea, but how do I change it to my time zone (Eastern Time with daylight savings)? Any help is greatly appreciated.

 
mark bryan yu Scriptwright

if you want to retain eBay's date/time format mmm-dd-yy, add this function:

function convertMonth(x)
{
if (x == 1)
return "Jan";
if (x == 2)
return "Feb";
if (x == 3)
return "Mar";
if (x == 4)
return "Apr";
if (x == 5)
return "May";
if (x == 6)
return "Jun";
if (x == 7)
return "Jul";
if (x == 8)
return "Aug";
if (x == 9)
return "Sep";
if (x == 10)
return "Oct";
if (x == 11)
return "Nov";
if (x == 12)
return "Dec";
}

and change this line:

var dstr = d.getFullYear() + '-' + nf(d.getMonth() + 1) + '-' + nf(d.getDate()) + ' ' + nf(d.getHours()) + ':' + nf(d.getMinutes()) + ':' + nf(d.getSeconds()) + " " + tzinfo[1];

to

var dstr = convertMonth(d.getMonth() + 1) + '-' + nf(d.getDate()) + '-' + String(d.getFullYear()).substring(2) + ' ' + nf(d.getHours()) + ':' + nf(d.getMinutes()) + ':' + nf(d.getSeconds()) + " " + tzinfo[1];

 
mark bryan yu Scriptwright

Regarding Tommy's bug report. The script doesn't handle Day Light Saving Time and PST is hardcoded in the script. To fix this:

replace the regex expression 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)/);

and replace the Date constructor to:

var d = new Date(foo[1] + ' ' + foo[2] + ' 20' + foo[3] + ' ' + foo[5] + " " + foo[6]);

hope this helps

 
Tommy Jensen User

Great idea and a welcome addon but It really doesn't change anything for me. All times on ebay.com are still in PDT.

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