Reputation: 31
I need to get a string representation of the current timestamp in format YYYY-MM-DDThh:mm:ssZ
Upvotes: 3
Views: 1740
Reputation: 39466
See the Date
class, and the following properties (in order based on your question):
var date:Date = new Date();
var answer:String = date.fullYear + "-" + (date.month+1) + "-" + date.date + " " + date.hours + ":" + date.minutes + ":" + date.seconds;
trace(answer); // 2012-1-17 10:48:41
Upvotes: 6