Name
Date( ) Global Function — a string representing the current date and time
Availability
Flash 5
Synopsis
Date( )
Returns
A string containing the current date and time.
Description
The Date( ) function returns a human-readable
string that expresses the current date and time relative to the local
time zone. The string also includes the GMT offset (the number of hours difference
between local time and Greenwich Mean Time).
Be sure not to confuse the global Date( )
function with the Date( ) class constructor. The
Date( ) function returns the date formatted as a
standard, if terse, string. It is convenient for humans but not very
useful inside a program where you need to manipulate dates and times.
For that purpose, you are better off using objects of the
Date class, which allow convenient independent
access to the year, month, day, and time.
Example
To place the current time and date in a text field with minimal fuss,
we can use the Date( ) function as follows:
myTextField = Date( ); // Sets myTextField to a string formatted as follows: // "Mon Aug 28 16:23:09 GMT-0400 2000"
See Also
The Date class, Date.UTC( )
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access