Take the 2-minute tour ×

I have such response from server Date = "/Date(1348783200000+0200)/" how can I parse it to timestamp or date (example: Monday 21, September, 2012)?? please help..

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

It looks like your date is in milliseconds. You will need to divide by 1000 and cast it into an NSDate after that. Then you can just use NSDateFormatter with NSDateFormatterLongStyle to show the date in that format.

NSTimeInterval dateInterval = dateWithMilliseconds;
dateInterval = dateInterval / 1000;
NSDate *date = [NSDate dateWithTimeIntervalSince1970:dateInterval];

NSDateFormatter *formatter = [NSDateFormatter alloc] init];
[formatter setDateStyle:NSDateFormatterLongStyle];
NSString *dateString = [formatter stringFromDate:date];
share|improve this answer
Thanks!! its working good! =) –  LightNight Sep 14 '12 at 14:57
add comment

Your Answer


