User Guide

356 ActionScript classes
toString (Date.toString method)
public toString() : String
Returns a string value for the specified date object in a readable format.
Availability: ActionScript 1.0; Flash Lite 2.0
Returns
String - A string.
Example
The following example returns the information in the
dateOfBirth_date Date object as a
string. The output from the trace statements are in local time and vary accordingly. For Pacific
Daylight Time the output is seven hours earlier than universal time: Mon Aug 12 18:15:00
GMT-0700 1974.
var dateOfBirth_date:Date = new Date(74, 7, 12, 18, 15);
trace (dateOfBirth_date);
trace (dateOfBirth_date.toString());
UTC (Date.UTC method)
public static UTC(year:Number, month:Number, [date:Number], [hour:Number],
[minute:Number], [second:Number], [millisecond:Number]) : Number
Returns the number of milliseconds between midnight on January 1, 1970, universal time,
and the time specified in the parameters. This is a static method that is invoked through the
Date object constructor, not through a specific Date object. This method lets you create a
Date object that assumes universal time, whereas the Date constructor assumes local time.
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
year:Number - A four-digit integer that represents the year (for example, 2000).
month:Number - An integer from 0 (January) to 11 (December).
date:Number [optional] - An integer from 1 to 31.
hour:Number [optional] - An integer from 0 (midnight) to 23 (11 p.m.).
minute:Number [optional] - An integer from 0 to 59.
second:Number [optional] - An integer from 0 to 59.
millisecond:Number [optional] - An integer from 0 to 999.