1

I want to convert a string like "2012-03-08T00:00:00+01:00" into Date..

I tried to use Dateformatter with "YYYY-MM-dd HH:mm" but it doesn't work (error while parsing).

Any idea ?

Thanks a lot.

2
  • Where are you getting the string from? Is the source under your control? If it is, you might want to use timestamps.. they will offer you much better control Commented Apr 3, 2012 at 6:20
  • 2
    But your pattern doesn't match the date format ! Where is the T, where are seconds ? and timezone ? Commented Apr 3, 2012 at 6:21

1 Answer 1

3

This pattern should match : yyyy-MM-dd'T'HH:mm:ssZ

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.