开发者

POST with JSON in format DateTime

开发者 https://www.devze.com 2023-03-09 14:33 出处:网络
Im struggling a lot with how I can format a NSDate to POST it as JSON to RE开发者_StackOverflowST service .net. The accepted format is:

Im struggling a lot with how I can format a NSDate to POST it as JSON to RE开发者_StackOverflowST service .net. The accepted format is:

"Date":"\/Date(459842400000+0200)\/"

I have no problem with the response and to parse it to NSDate. I use JSONFramework for parsing.

Any suggestions?


Take a look at the NSDateFormatter and NSDate classes.

From your example it looks like you want to build a string with Date(Timestamp + TimeZone). There are two methods that do that, timeIntervalSince1970 (NSDate) and timeZone (NSDateFormatter).

0

精彩评论

暂无评论...
验证码 换一张
取 消