How to convert UTC time into date time format in flex. I am using sdk 3.5. for example I have current date time in UTC format as 1309522586000 (milliseconds) and I want to convert it to friday jul 1 2011. How can I do this??
Thanks
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.
If your are using a UNIX timestamp that you are retrieving from your server, first you will have to multiply it by 1000.
This is because UNIX timestamps are expressed in seconds whereas ActionScript timestamps are expressed in milliseconds.
You can create a date from your timestamp as follows:
Next, you create a formatDate function that you call with myDate as parameter:
Notice that I am using a dateformatter to format the date correctly.
More about DateFormatter and possible formats here: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/formatters/DateFormatter.html
Cheers