I have a service that give me a date time string in the following format
2012-03-19T12:59:00Z
I need to convert that into a Date object in flex 4. How do I do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Have a look at Date.parse().
It looks like you might need to do a String.replace() or similar operation on the String you pass to the parse() method, for it to succeed.
A better solution, if it is under your control, is to have the service return the date/time string as an epoch time (in milliseconds). Then on the Flash side, you can just construct a new
Dateobject passing in the time (in milliseconds) to the constructor: