I have a NSString filled with the following from my json parser.
"2013-08-22 00:00:00";
How i can i remove the timestamp from this? "00:00:00";
Thanks.
P.s i tried using the substringWithRange:NSMakeRange function.
I have a NSString filled with the following from my json parser.
"2013-08-22 00:00:00";
How i can i remove the timestamp from this? "00:00:00";
Thanks.
P.s i tried using the substringWithRange:NSMakeRange function.
If the date format in the string will remain same, then you can split the string based on the space in between.
Code to do that is:
NSString *date = @"2013-08-22 00:00:00";
NSArray *split = [date componentsSeparatedByString:@" "];
//split[0] => Date part
//split[1] => Time part
This is a quick fix.
Hope that helps!