From September, Flash will no longer be supported by Chrome. Prepare for the shift towards HTML5 by visiting our Flash to HTML5 help page

Check it out!

Adform Date Class

  • Info

    AdformDate class helps getting the date related information without any additional calculations. The received data is usually registered as time in miliseconds. The class is supported in both the ActionScript 2 and ActionScript 3 versions.

  • Dependencies

    In order to use this class in the ActionScript 3 banner, AdformCore component must be placed on the stage. Otherwise, some of the properties may not be accurate.

  • Public Properties

    serverTime
    serverTime:Number [static] [read-only]

    Gets the number of milliseconds since midnight January 1, 1970, universal time. Use this property in order to get the current Adform server time depending on its time zone.

    Implementation

    static public function get serverTime():Number


    Example

    var serverTime:Number = AdformDate.serverTime;
    trace(serverTime);           // 1367241500718
    trace(serverTime); // 1367241500718



    timeDiff
    timeDiff:Number [static] [read-only]

    Gets the time difference in milliseconds between the current time of a user's machine and the Adform's server time. This property may return both positive and negative values.

    Implementation

    static public function get timeDiff():Number


    Example

    The time difference between the server and a user's machine is +1 hour.

    var timeDiff:Number = AdformDate.timeDiff;
    trace(timeDiff); // 3600000

    The time difference between the server and a user's machine is -2 hours.

    var timeDiff:Number = AdformDate.timeDiff;
    trace(timeDiff); // -7200000