i am new to iphone development. In my input date format is "2010-03-05T18:20:40Z", and i donno to how to give a input format of my code.So i have mentioned in my code (?).
input date format = "2010-03-05T18:20:40Z"
Here my code is:
NSString *indate = @"2010-03-05T18:20:40Z";
NSDateFormatter *inputFormatter = [[NSDateFormatter alloc] init];
[inputFormatter setDateFormat:@"????????????????????????"];
NSDate *inputDate = [inputFormatter dateFromString:indate];
NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init];
[outputFormatter setDateFormat:@"EEE. MMM. d, yyyy"];
NSString *outputDate = [outputFormatter stringFromDate:inputDate];
lDate.text = outputDate;
Plz help me out.
Thanks.
To set and get the input type date in dd-mm-yyyy format we will use <input> type attribute. The <input> type attribute is used to define a date picker or control field. In this attribute, you can set the range from which day-month-year to which day-month-year date can be selected from.
Question: Q: Change the date format to dd/mm/yyyy Answer: A: Go to Settings/General/Language & Region and choose a region where that is the standard.
try this out Formatting NSDate into particular styles for both year, month, day, and hour, minute, seconds
"yyyy-MM-dd'T'HH:mm:ss'Z'"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With