Created
March 27, 2014 13:01
-
-
Save Fogh/9807038 to your computer and use it in GitHub Desktop.
NSDate to WCF JSON date string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSString *)dateToJSONDate:(NSDate *)date | |
{ | |
NSDateFormatter *formatter = [NSDateFormatter new]; | |
[formatter setDateFormat:@"Z"]; | |
return [NSString stringWithFormat:@"/Date(%.0f000%@)/", [date timeIntervalSince1970], [formatter stringFromDate:date]]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment