Livecode Wiki
Advertisement

Specifies whether the date and time functions should be formatted in accordance with the user's system preferences, or in the standard format used in the United States.

Syntax:

set the useSystemDate to {true | false}

Examples:

set the useSystemDate to true

Use the useSystemDate property to correctly format dates and times that will be viewed by the user (for example, dates and times that are displayed in a field).

Setting the useSystemDate property to true does the same thing as using the system keyword with the date or time functions. If the useSystemDate is set to true, the date and time functions return the same value as the system date and the system time, respectively. If the useSystemDate is set to false, the date and time functions return the same value as the english date and the english time, respectively.

Example:

set UseSystemDate to false
put the date #returns "4/15/17"  , i.e. 15th April 2017
set UseSystemDate to true
put the date # returns "15/04/2017", i.e. 15th April 2017


The system format is set by the Date & Time control panel (on Mac OS systems), the Date control panel (on Windows systems), or the LANG environment variable (on Unix systems).

Since the useSystemDate is a local property, its value is reset to false when the current handler finishes executing. It retains its value only for the current handler, and setting it in one handler does not affect its value in other handlers it calls.

See also: dateFormat (function), format (function), date (function), value (function),

Advertisement