. Net Time Format and sleepless me,. net Time Format

Source: Internet
Author: User
Tags net time

. Net Time Format and sleepless me,. net Time Format

The night is deep, and the wind outside is still screaming. My feet are cold and cold... From till now, I have been testing why the 400 error is still reported after the strings in the correct Json format are uploaded to the server...

Nima, there was no problem with the previous tests.

This is the case. After converting a class to a dictionary in ios, I used the AFNetwork to transmit it to the server. I have been reporting the 400 Error and checked the program several times, in the end, this is the only way to output the dictionary Json string. Use fiddler to test the server... I had to flip the Json string that I tested before...

In one-to-one comparison, the current json string has one more time and two id values, and can be deleted and re-transmitted ..

I first thought of the pitfall of yesterday. The json time format obtained from the server is "postTime": "/Date (1408943415760 + 0800)/" similar to this, is it necessary to return... If so, it is the reason,

When I input a "postTime": "/Date (1408943415760 + 0800)/", the breakpoint of the vertex finally takes effect, and the passed class is initialized normally. Let's take a look at it and change the postTime attribute of the class to the string type. Can we pass in "1:00:00" and pass in again?

If the cause is found, there are two solutions: Change the postTime attribute of the class to string and process it by string after reading from the database, the data is also processed by string during transmission, so it does not need to be parsed. NSDateFormatter is used directly on the app side for processing.

Another method is to format the input time in IOS as the time interval (from 1970), hoping to provide a better solution.

My solutions are not necessarily suitable. I hope to discuss them in a better way.

Related Article

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.