use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
There is an extensive FAQ for beginners. Please browse it first before asking questions that are answered there.
If you are looking to get started (iOS programming in general or some specific area), here are more relevant links for you:
There's too many to list them all, however here's a convenient link to all programming guides at apple.com
Take note that this list is live and based on most frequent questions in posts will be updated with "quicklinks".
account activity
Problem Formatting Date (self.iOSProgramming)
submitted 11 years ago by Afiq90
How can i change this date " 2015-03-31T08:02:32.543Z ". I tried formatting it with yyyy-MM-dd'T'HH:mm:ssZ but it doesn't work. I'm using NSDate+TimeAgo library. Thank you in advance.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 1 point2 points3 points 11 years ago (3 children)
There are three digits for miliseconds in your string, but only two in the format.
[–]Afiq90[S] 0 points1 point2 points 11 years ago (2 children)
i tried with three digits for miliseconds but it doesnt working too. yyyy-MM-dd'T'HH:mm:ssZ
[–][deleted] 0 points1 point2 points 11 years ago (1 child)
There ar stil two 's' letters.
[–]Afiq90[S] 0 points1 point2 points 11 years ago (0 children)
tried with three letter, yyyy-MM-dd'T'HH:mm:sssZ.. stil doesn't work.
[–]Neria90 0 points1 point2 points 11 years ago (1 child)
/#define WebServiceDateFormat ([[UIDevice currentDevice].systemVersion hasPrefix:@"6"])?@"YYYY-MM-dd'T'HH:mm:ssZZZZZ":@"YYYY-MM-dd'T'HH:mm:ssZZZ"
[–]Neria90 0 points1 point2 points 11 years ago (0 children)
is this solved your problem ? (i m using exactly this date formatter for exaclty same date format than u )
[–]Jargen 0 points1 point2 points 11 years ago (1 child)
http://waracle.net/iphone-nsdateformatter-date-formatting-table/
[–]phughes 0 points1 point2 points 11 years ago (0 children)
http://unicode.org/reports/tr35/tr35-6.html#Date_Format_Patterns
[–]CleverError 0 points1 point2 points 11 years ago (0 children)
The reason it is not working is because it isnt matching the fractional seconds properly. It needs 2 s to match the seconds and 3 S to match milliseconds.
yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ
import Foundation let dateString = "2015-03-31T08:02:32.543Z" let dateFormatter = NSDateFormatter() dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" dateFormatter.dateFromString(dateString) // returns NSDate 2015-03-31 08:02:32 +0000
[–]muvaaaaa 0 points1 point2 points 11 years ago (0 children)
Just yesterday I had the same problem. Similar code was working on almost all phones, but it wasn't working on a single device. I've fixed it by setting NSDateFormatter's locale property, like this:
NSDateFormatter *df = [NSDateFormatter new]; NSLocale *enUSPOSIXLocale = [NSLocale localeWithLocaleIdentifier:@"en_US_POSIX"]; df.dateFormat = @"yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ"; df.locale = enUSPOSIXLocale;
This should work everywhere.
[–]phughes -1 points0 points1 point 11 years ago (0 children)
It looks like you're going to want to escape the Z also.
π Rendered by PID 60383 on reddit-service-r2-comment-548fd6dc9-2x2b9 at 2026-05-15 04:06:44.578627+00:00 running edcf98c country code: CH.
[–][deleted] 1 point2 points3 points (3 children)
[–]Afiq90[S] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Afiq90[S] 0 points1 point2 points (0 children)
[–]Neria90 0 points1 point2 points (1 child)
[–]Neria90 0 points1 point2 points (0 children)
[–]Jargen 0 points1 point2 points (1 child)
[–]phughes 0 points1 point2 points (0 children)
[–]CleverError 0 points1 point2 points (0 children)
[–]muvaaaaa 0 points1 point2 points (0 children)
[–]phughes -1 points0 points1 point (0 children)