User Guide
282 Chapter 12: Methods
date() (formats)
Usage
-- Lingo syntax syntax
date({stringFormat})
date({intFormat})
date({intYearFormat, intMonthFormat, intDayFormat})
// JavaScript syntax
Date({“month dd, yyyy hh:mm:ss”});
Date({“month dd, yyyy”});
Date({yy,mm,dd,hh,mm,ss});
Date({yy,mm,dd});
Date({milliseconds});
Description
Top level function and data type. Creates a standard, formatted date object instance for use with
other date object instances in arithmetic operations and for use in manipulating dates across
platforms and in international formats.
Lingo date objects and JavaScript syntax date objects are different; therefore, Lingo date objects
cannot be created using JavaScript syntax, and JavaScript syntax date objects cannot be created
using Lingo syntax.
Create a new JavaScript syntax Date object using the
new Date() syntax. Case is important in
JavaScript syntax. For example, using
new date() results in a runtime error.
When creating a date using Lingo, use four digits for the year, two digits for the month,
and two digits for the day. The following expressions all return a date object equivalent to
October 21, 2004.
The individual properties of the returned date object are as follows.
Addition and subtraction operations on the date are interpreted as the addition and subtraction of
days.
Parameters
stringFormat
Optional when creating a Lingo date object. A string that specifies the new
date object.
Date Format Usage
string
date(“20041021”)
integer
date(20041021)
comma separated
date(2004, 10, 21)
Property Description
#year An integer representing the year
#month An integer representing the month of the year
#day An integer representing the day of the month