0

I am using an angularjs date time picker that when used directly is in the format of:

2016-01-18T05:00:00:000Z

this angularjs format works for me, but later I store it off and when retrieved it is in the format of:

Mon Jan 18 2016 00:00:00 GMT-0500 (Eastern Standard Time)

Which does not work for me. So I need to take the non-working String representation of the date (second one), and convert it into my working representation (first one). I would imagine I have to convert it like String > Date > Diff String, but looking at SimpleDateFormat I don't even see where the T comes from in 2016-01-18T05:00:00:000Z

3
  • It's just a literal. Text can be quoted using single quotes (') to avoid interpretation. "''" represents a single quote. Commented Apr 28, 2016 at 21:02
  • @SotiriosDelimanolis what am I trying to avoid interpretation of? Commented Apr 28, 2016 at 21:05
  • The -T part of the target format. It'll be added literally during format. Commented Apr 28, 2016 at 21:07

1 Answer 1

2

Your first format is ISO 8601 Time zone. Try use the pattern yyyy-MM-dd'T'HH:mm:ss.SSSZ.

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

1 Comment

does EEE MMM dd yyyy HH:mm:ss zZ '('zzzz')' match the second format correctly (Mon Jan 18 2016 00:00:00 GMT-0500 (Eastern Standard Time))?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.