Brian Miller Posted June 24, 2017 Share Posted June 24, 2017 I'm new to Objective-C and I need your help on converting a number to a legible date value and am not sure how to do it. I have an NSNumber that looks like this: 20170624162459 (It's a numeric only format of the ISO 8601 date format "YYYYMMDDHHmmSS"). And I would like it converted in to an NSString like: 24th of June, 2017. 4:24 PM. Can someone help to convert the number for me? I'm at a total loss and don't know Objective-C well enough to make a function to do this. Thanks. Link to comment https://www.neowin.net/forum/topic/1334476-ios-date-conversion-and-formatting-in-obj-c/ Share on other sites More sharing options...
0 Brian Miller Posted June 25, 2017 Author Share Posted June 25, 2017 Anyone? Link to comment https://www.neowin.net/forum/topic/1334476-ios-date-conversion-and-formatting-in-obj-c/#findComment-597938778 Share on other sites More sharing options...
0 Above The Gods Posted September 16, 2017 Share Posted September 16, 2017 NSNumber *date = @20170624162459; NSString *stringDate = [date stringValue]; Link to comment https://www.neowin.net/forum/topic/1334476-ios-date-conversion-and-formatting-in-obj-c/#findComment-598029828 Share on other sites More sharing options...
Question
Brian Miller
I'm new to Objective-C and I need your help on converting a number to a legible date value and am not sure how to do it.
I have an NSNumber that looks like this: 20170624162459 (It's a numeric only format of the ISO 8601 date format "YYYYMMDDHHmmSS").
And I would like it converted in to an NSString like: 24th of June, 2017. 4:24 PM.
Can someone help to convert the number for me? I'm at a total loss and don't know Objective-C well enough to make a function to do this.
Thanks.
Link to comment
https://www.neowin.net/forum/topic/1334476-ios-date-conversion-and-formatting-in-obj-c/Share on other sites
2 answers to this question
Recommended Posts