문제

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