/ Published in: ActionScript 3
Simple as this! var nowunixtimestamp:String = convertToUnix(new Date());
Expand |
Embed | Plain Text
public function convertToUnix(value:Date):String { var currentDate = value.date; var currentMonth = value.month; var currentYear = value.fullYear; var dt:Date = new Date(currentYear, currentMonth, currentDate + 1); return Math.round(dt.getTime()/1000).toString(); }
Comments
Subscribe to comments
You need to login to post a comment.

value.getTime() does the same thing..