Вопрос

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!

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top