string.dateString

Syntax string.dateString (d = clock.now ())

Params d is an optional date parameter. The default is the current date.

Action Return the date as a string, the formatting depends on system-level user settings.

Returns The date in the form of a string. Commas are used to separate the elements. By default, and unless the user changes the format at the system level, the date includes the day of the week followed by a comma, the month and date followed by a comma, and the year.

Examples string.dateString ()

   » Thu, Sep 06, 1991

string.dateString ()

   » Sep 06, 1991

In this example, the return value indicates that the user has reset system format to omit the day of the week.

ch = string.getWordChar ();
string.setWordChar (', ');
dayOfWeek = string.firstWord (string.dateString ());
string.setWordChar (ch);
msg (dayOfWeek)

   » True // dayOfWeek is displayed in the Main Window.

This script returns the current day of the week; it assumes the default U.S. date format.

Notes Since the user has some control over the format of the date and over the delimiters used to separate the elements of the date, it is wise not to make any unwarranted assumptions in extracting and using date information. Use date.get in conjunction with clock.now for this purpose. The default date format also varies by operating system.

Before Frontier 6.1 this verb did not require a date parameter.

See Also string.timeString

clock.now

date.get

Discuss