Lingo Dictionary > D-F > date() (system clock)

 

date() (system clock)

Syntax

the abbr date
the abbrev date
the abbreviated date
the date
the long date
the short date

Description

Function; returns the current date in the system clock in one of three formats: abbreviated, long, or short (default). The abbreviated format can also be referred to as abbrev and abbr.

In Java, the date function is available, but it doesn't accept abbrev, long, or short modifiers. When the movie plays back as an applet, the date's format is MM/DD/YY, where MM represents the month, DD represents the day, and YY represents the last two digits of the current year. For the months January through September, the value for MM is a single digit.

The format Director uses for the date varies, depending on how the date is formatted on the computer.

In Windows, you can customize the date display by using the International control panel. (Windows stores the current short date format in the System.ini file. Use this value to determine what the parts of the short date indicate.)

On the Macintosh, you can customize the date display by using the Date and Time control panel.

Example

This statement displays the abbreviated date:

put the abbreviated date
-- "Sat, Sep 7, 1991"

Example

This statement displays the long date:

put the long date
-- "Saturday, September 7, 1991"

Example

This statement displays the short date:

put the short date
-- "9/7/91"

Example

This statement tests whether the current date is January 1 by checking whether the first four characters of the date are 1/1. If it is January 1, the alert "Happy New Year!" appears:

if char 1 to 4 of the date = "1/1/" then alert "Happy New Year!"

Note: The three date formats vary, depending on the country for which your operating system was designed. These examples are for the United States. Use the date object to create and manipulate dates in a standard format.

See also

time(), date() (formats), systemDate