Wrong time from NSDateFormatter
I have a string that I want to parse the time from: NSString *longdate = @”Mar 27, 2011 8:38:38 PM”; I want to parse this date and output just the time portion w/ hours+minutes+am/pm: // First, convert our string into an NSDate NSDateFormatter *inFormat = [[NSDateFormatter alloc] init]; [inFormat setDateFormat:@”MMM dd, yyyy HH:mm:ss aaa”]; NSDate […]
NSDateFormatter won't format strange date string
So I have a date string I receive that looks like this: “2013-03-20T21:13:26-7:00” that I receive from a web back end. I have no control over the back end, just a fyi. My preference would be to have the date formatted like this: 9:13pm at 3/20. When I do the following NSDateFormatter *dateFormatter = [[NSDateFormatter […]
Is there some functionality in Cocoa to display time intervals in natural language?
What I am searching for is a Cocoa (or third party) class that can display time intervals in natural language, e.g.: 10 seconds ago 1 hour ago 2 days ago Do you know anything that could help me to achieve this task without writing it by myself and melting in if-else hell?
Formatting a DateTime object from .NET into a NSDate for objective-c
I am working with an API that returns a .NET DateTime object into my iOS application. I’m a little confused at what’s going on, the DateTime looks fine when it leaves the API, but when it comes in it goes through JSON and comes in as a string that looks like this: /Date(1303884000000-0600)/ WTF is […]
my NSDateFormatter works only in the iPhone simulator
I use a NSDateFormatter which works fine in the simulator, but I get a nil when I run it in the iPhone. I hardcoded the date to be sure of the format, but it fails anyway. NSString *strPubDate = @”Fri, 8 May 2009 08:08:35 GMT”; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4]; [dateFormatter setDateFormat:@”EEE, […]
UIdatepicker showing weekdays
I would like to make a datepicker that shows weekdays, date and month. I got a working datepicker showing month, date and year but I would really like it to show month, day, date How is this possible? I know I might have to make a custom UIpicker, but how to I make this refer […]