Posted By

arpit on 03/18/10


Tagged

date


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

socialflasher
tspitzr


Converting Java DateTime to AS3 Date


 / Published in: ActionScript 3
 

Patterns: http://www.geekzilla.co.uk/View00FF7904-B510-468C-A2C8-F859AA20581F.htm

  1. var dateTime:Array = dateString.split("T")
  2. var dateParts:Array = dateTime[0].split("-")
  3. var timeString:String = String(dateTime[1])
  4. timeString = timeString.substr(0,timeString.length-1)
  5. var timeParts:Array = timeString.split(":")
  6.  
  7. var d:Date = new Date(dateParts[0], (dateParts[1]-1), dateParts[2], timeParts[0], timeParts[1], timeParts[2]);
  8. return d;

Report this snippet  

You need to login to post a comment.