Date and time
dBASE Plus supports two types of dates:
A primitive date that is compatible with earlier versions of dBASE
A JavaScript-compatible Date object.
A Date object represents a moment in time. It is stored as the number of milliseconds since January 1, 1970 00:00:00 GMT (Greenwich Mean Time). Although GMT and UTC (a compromise between the English and French acronyms for Universal Coordinated Time) are derived differently, they are considered to represent the same time.
Modern operating systems have their own current time zone setting, which is used when handling Date objects. For example, two computers with different time zone settings—whether or not they are physically in different time zones—will display the same time differently.
Primitive dates represent the date only, not the time. (They are considered to be the first millisecond—midnight—of that date.) Literal dates are delimited by curly braces and are evaluated according to the rules used by the CTOD( ) function. An invalid literal date is always converted to the next valid one; for example, if the current date format is month/day/year, {02/29/1997} is considered March 1, 1997. An empty date is valid and is represented by empty braces: { }.
dBASE Plus will convert one type of date to the other on-the-fly as needed. For example, you may use a Date class method on a primitive date variable or a literal date:
? date( ).toGMTString( )
? {8/21/97}.toString( )
This creates a temporary Date object from which the method or property is called. Because the object is a temporary copy, calling the set methods or assigning to the properties is allowed, but has no apparent effect. You may also use a date function on a Date object, in which case the time portion of the Date object will be truncated.
Note
While the JavaScript-compatible methods are zero-based, dBL functions are one-based. For example, the getMonth( ) method returns 0 for January, while MONTH( ) returns 1.
dBASE Plus also features a Timer object that can cause actions to occur at timed intervals.