Getting unix timestamp in milliseconds in PHP5 and Actionscript3

后端 未结 12 2577
被撕碎了的回忆
被撕碎了的回忆 2020-12-16 09:58

In Actionscript, the Unix timestamp in milliseconds is obtainable like this:

public static function getTimeStamp():uint
        {
            var now:Date =          


        
12条回答
  •  生来不讨喜
    2020-12-16 10:36

    For actionscript3, new Date().getTime() should work.


    In PHP you can simply call time() to get the time passed since January 1 1970 00:00:00 GMT in seconds. If you want milliseconds just do (time()*1000).

    If you use microtime() multiply the second part with 1000 to get milliseconds. Multiply the first part with 1000 to get the milliseconds and round that. Then add the two numbers together. Voilá.

提交回复
热议问题