Skip to main content
January 30, 2007
Question

Setting A GMT Value Of A Date Object

  • January 30, 2007
  • 2 replies
  • 225 views
I have a date string which I am breaking apart to create a date object

Tue, 30 Jan 2007 2:52 pm CST

How do I convert the time zone (CST) so it is the proper GMT value in the date object?

Thanks
Mathias
This topic has been closed for replies.

2 replies

January 31, 2007
I'm probably not explaing the question correctly.

How would I convert the time zone indicator I am getting in my string to the proper GMT offset for the users local time?

I would then want to add 60 (a value also in the rss feed) minutes onto that time, so I would know when to next check for a weather update.

Thanks
Mathias
Marghoob Sulemaan
Inspiring
January 31, 2007
Can you show me your code... did you know that CST is 6 hours slow than GMT so you you could have a formula.

time = CST + 6 hours

if you could share your code it would be great to help you...
January 31, 2007
Here is the code. I am getting the time string from the Yahoo weather. I want to figure out the next time it will be updated. I am trying to build a weather window and I want to go check for changes.
I use the .setHours to set the time, but I do not see an option to set the GMT or time zone