I want to parse a date string that I receive from a web service. However, I sometimes receive the date with decimal component and sometimes without decimal component. Also, sometimes the date comes with a different number of decimal digits.
Assume you got the following date:
NSString *dateString = @"2013-07-22T220713.9911317-0400";
How can remove the decimal values? I want to end up with:
@"2013-07-22T220713-0400";
So I can process it with the DateFormatter that uses no decimal.