If you are using NSDateFormatter to send dates back to a server be VERY careful. Specifying a date format string as follows…
and the time for example is currently 09/10/2013 14:00:00, if the user has set their clock to be a 12-hour clock, instead of the default 24-hour clock. You will get a string back of…
The users preferences overwrite what you are asking for!!
Read the following documentation - https://developer.apple.com/library/ios/documentation/cocoa/Conceptual/DataFormatting/Articles/dfDateFormatting10_4.html
The following sample code from that article will always return a 24-hour clock value regardless of user preferences
<br /><br />NSDateFormatter *rfc3339DateFormatter = [[NSDateFormatter alloc] init];<br /><br />NSLocale *enUSPOSIXLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"];<br /><br />[rfc3339DateFormatter setLocale:enUSPOSIXLocale];<br /><br />[rfc3339DateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss"];<br /><br />[rfc3339DateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];<br /><br />NSDate *date = [rfc3339DateFormatter dateFromString:rfc3339DateTimeString];<br /><br />
I’ve just come back from Dublin, Ireland, where I attended the Úll Conference to cover all things iOS related. When the tickets where first released, the conference was advertised as a 3 day affair, starting on Friday 27th April and ending on the Sunday. A friend from Ireland, @realmikebutler, had told me about the conference so I got an early bird ticket as soon as they came up, without knowing any details.
The actual schedule, without talkers, wasn’t released until later and it looked like the conference was in fact only 1.5 days, talks Friday evening, Saturday and a BBQ on Sunday. I’d already booked my flights and hotel, arriving on the Thursday and coming back on the Monday, as I’d expected 3 full days of iOS talks. A couple of talks were later scheduled for the Friday afternoon, so I signed up for Josh Clark (@globalmoxie), TapWorthy talk.
So when the day arrived to head to Dublin I was heading off feeling pretty disappointed, but saw it as an opportunity to meet Mike again so all would not be lost.
I’m pleased to say that once the Friday talks started my disappointment vanished, Josh’s session was fantastic, really got you thinking about how to go about designing apps. Then the evening bash at the Sugar Club, was just inspired, the talk by Horace Dediu (@asymco) was informative and Aral Balkan (@aral) brought amazing humour to the evening, I’ll never forget the toilet videos.
We all agreed by the end of the first day that the conference was worth attending and we still had a day to go!
The main talks could not of been better, all of the speakers were enthusiastic about their subjects and gave everyone a lot to think about. A couple really stood out for me, Chris Harris (@_ChrisHarris) gave a demo of the app he created for the BBC, Wonders of the Universe. During a break he also showed me how he had created all of the graphical content using the iPad itself, using the power of the device to the max. The other talk was by Jim Dalrymple (@jdalrymple), writer of the blog The Loop, it was interesting to hear the app marketing nightmare from the other side of the fence.
There was also plenty of time to talk to fellow attendees, and as a freelancer this was as important as the talks themselves. You realise that you are part of a community, that there are others out there trying to do the same as you, with the same doubts and uncertainty, and that really does help. The BBQ on the Sunday just kept that feeling of community going, what a great idea.
I’m now ashamed of my initial disappointment, as the old saying goes “don’t judge a book by its cover”. The conference was one of the best I’ve ever attended both speakers and fellow attendees. The organisers, Paul Campbell (@paulca) and Dermot Daly (@dermdaly), did an amazing job and deserve a big THANK YOU.
I can’t wait for next years conference, I just hope they don’t sell out as quickly as WWDC