
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
Содержание DIRECTOR MX 2004-DIRECTOR SCRIPTING
Страница 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Страница 48: ...48 Chapter 2 Director Scripting Essentials...
Страница 100: ...100 Chapter 4 Debugging Scripts in Director...
Страница 118: ...118 Chapter 5 Director Core Objects...
Страница 594: ...594 Chapter 12 Methods...
Страница 684: ...684 Chapter 14 Properties See also DVD...
Страница 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Страница 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Страница 889: ...netPresent 889 _player alert Sorry the Network Support Xtras could not be found See also Player...
Страница 1102: ...1102 Chapter 14 Properties...