JSON serialization date problems

Source: Internet
Author: User

In other words, a function module named 'event calendar 'has been encountered in the project recently ',

Therefore, jquery + ashx is used to complete (you need to dynamically draw the calendar AR ),

Similar to Google Calendar,

In the near future, you will experience the following in vnet :-),

The server uses the json.net serialized object to return JSON format data,

The result shows that the date is always not correct. After debugging, we find that the date is in GMT format, orz...

Fortunately, json.net is open-source. Now, let's take a look at the time zone. t.t ..

Someone proposed a more harmonious method, that is, to modify the source code of json.net, minus the current time zone ....

If you think about it, give up the "Harmony" method and solve it on the client,

Year, month, date, hour, minute... all values in UTC format:

E.g.: D. getutcmonth ()..

OK, solve the problem ^!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.