/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function getYYMMDD():String { var dateObj:Date = new Date(); var year:String = String(dateObj.getFullYear()); var month:String = String(dateObj.getMonth() + 1); if (month.length == 1) { month = "0"+month; } var date:String = String(dateObj.getDate()); if (date.length == 1) { date = "0"+date; } return year.substring(2, 4)+month+date; } trace(getYYMMDD()); // OUTPUT // 100604