O'Reilly logo

Lingo in a Nutshell by Bruce A. Epstein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Date and Time Functions

You might want to know the date and time to create a Projector that expires after a certain date (see Example 11-7) or to provide a different introduction depending on the day of the week. The date and time are always returned as strings, but their format will vary with the user’s configuration and language. Use the value() function to convert a portion of the string to an integer.

Date Properties

Both Macintosh and Windows support separate short date and long date formats, which are used by Director’s the short date and the long date properties. Table 11-5 shows the basic date formats. Under Windows 3.1, the date format is set in the International control panel and stored in the SYSTEM.INI file. Under Windows 95, it is configured using the Date tab of the Regional Settings control panel (not the Date/Time control panel). On the Macintosh, it is configured using the Date Formats option in the Date & Time control panel.

Table 11-5. Date Formats

Date Command

Format Depends on

Typical U.S. Example

the date

the short date

OS’s short date setting, such as MM/DD/YY

12/05/97

the abbr date

the abbrev date

the abbreviated date

OS’s long date setting with abbreviated month name and weekday

Fri, Dec 05, 1997

the long date

OS’s long date setting

Friday, December 05, 1997

Date Formats and Y2K

The user may have changed the style of the date formats including the order of the fields within each format. Moreover, the default format varies for different countries and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required