Question

When using Google Feed API JSON result the origin RSS is being converted a day off in the JSON results.

For example the following origin RSS entry:

<pubDate>Mon, 19 Aug 2013 04:00:00 GMT</pubDate>

...becomes:

"Sun, 18 Aug 2013 21:00:00 -0700"

...in the JSON result. Is there any way to designate a time zone so it knows not to convert?

Thanks in advance!

Was it helpful?

Solution

There is no 'wrong day' in your question, both date strings are equivalent, just in different timezones. In your Javascript you can just construct a Date object from either one and then use the Date methods like either toLocaleString or toUTCString to represent it locally however you want it to.

Here's a sample Fiddle to play with.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top