Gdy chcemy odczytać datę w formacie unix we flashu, pojawia sie problem. Jest na to prosty sposób.
zmiena timestamp_in_seconds to nasza data w formacie UNIX.
//unix timestamp -> human date
var currDate:Date = new Date(timestamp_in_seconds*1000); //timestamp_in_seconds*1000 - if you use a result of PHP time function, which returns it in seconds, and Flash uses milliseconds
D = currDate.getDate();
M = currDate.getMonth()+ 1; //because Returns the month (0 for January, 1 for February, and so on)
Y = currDate.getFullYear();
var theDate:String = (M + "/" + D + "/" + Y);
Brak komentarzy:
Prześlij komentarz