How to parse a string to date using dateformatter in objective c

iPC

I have a string '2015-06-23T15:43:04.000+05:30' and i want to convert a date format like 23 June 2015 15:43

Сергей Олейнич

Try this one's:

NSString *temp = @"2015-06-23T15:43:04.000+05:30";
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"YYYY-MM-dd'T'HH:mm:ss.SSS'+05:30'"];
NSDate *dte = [dateFormat dateFromString:temp];
NSLog(@"Date: %@", dte);

NSDateFormatter *dF = [[NSDateFormatter alloc] init];
[dF setDateFormat:@"dd MMMM yyyy HH:mm"];
NSLog(@"%@", [dF stringFromDate:dte]);

In Console:

Date: 2015-06-23 12:43:04 +0000

23 June 2015 15:43

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to parse and validate a date in std::string in C++?

From Dev

parse JSON string into array of objects Objective C

From Dev

Getting date from string in objective C

From Dev

dateFormatter string for date type 2013-03-24T02:15:23-08:00 + objective C

From Dev

How to parse ISO 8601 date in objective-c

From Dev

How to parse JSONP in Objective-C?

From Dev

Objective C how do I parse this NSString

From Dev

Parse a UTC date string to date in C#

From Dev

Convert String to date Objective-C

From Dev

How do I best parse a date string in the Python C API?

From Dev

objective-c json parser: How to parse a json file starting with a string and not brackets?

From Dev

How to parse "MongoDB datetime (ISO Date)" to NSDate on iOS (swift and objective-c)

From Dev

How to parse given date string using moment.js?

From Dev

how to Parse String Date to MongoDB date type

From Dev

DateFormatter is returning nil date for a simple date string

From Dev

How to parse ISO 8601 date in objective-c

From Dev

java Date to sencha Date using dateFormatter

From Dev

Objective C how do I parse this NSString

From Dev

How to parse a string into date components using pure SQL?

From Dev

How do I Parse this Date String in C#

From Dev

How do I best parse a date string in the Python C API?

From Dev

how to print users of Parse in Objective C?

From Dev

How to parse JSON and get particular values using objective C?

From Dev

How to parse JSON in objective-C iOS

From Dev

Parse JSON response string in Objective - C

From Dev

Using DateFormatter to parse an esoteric date string

From Dev

Convert String date to Date doesn't work using dateFormatter and Swift

From Dev

How to parse String to Date object?

From Dev

how to parse xml response in objective c

Related Related

  1. 1

    How to parse and validate a date in std::string in C++?

  2. 2

    parse JSON string into array of objects Objective C

  3. 3

    Getting date from string in objective C

  4. 4

    dateFormatter string for date type 2013-03-24T02:15:23-08:00 + objective C

  5. 5

    How to parse ISO 8601 date in objective-c

  6. 6

    How to parse JSONP in Objective-C?

  7. 7

    Objective C how do I parse this NSString

  8. 8

    Parse a UTC date string to date in C#

  9. 9

    Convert String to date Objective-C

  10. 10

    How do I best parse a date string in the Python C API?

  11. 11

    objective-c json parser: How to parse a json file starting with a string and not brackets?

  12. 12

    How to parse "MongoDB datetime (ISO Date)" to NSDate on iOS (swift and objective-c)

  13. 13

    How to parse given date string using moment.js?

  14. 14

    how to Parse String Date to MongoDB date type

  15. 15

    DateFormatter is returning nil date for a simple date string

  16. 16

    How to parse ISO 8601 date in objective-c

  17. 17

    java Date to sencha Date using dateFormatter

  18. 18

    Objective C how do I parse this NSString

  19. 19

    How to parse a string into date components using pure SQL?

  20. 20

    How do I Parse this Date String in C#

  21. 21

    How do I best parse a date string in the Python C API?

  22. 22

    how to print users of Parse in Objective C?

  23. 23

    How to parse JSON and get particular values using objective C?

  24. 24

    How to parse JSON in objective-C iOS

  25. 25

    Parse JSON response string in Objective - C

  26. 26

    Using DateFormatter to parse an esoteric date string

  27. 27

    Convert String date to Date doesn't work using dateFormatter and Swift

  28. 28

    How to parse String to Date object?

  29. 29

    how to parse xml response in objective c

HotTag

Archive