date() (formats)
283
intFormat
Optional when creating a Lingo date object. An integer that specifies the new
date object.
intYearFormat
Optional when creating a Lingo date object. An integer that specifies the four-
digit year of the new date object.
intMonthFormat
Optional when creating a Lingo date object. An integer that specifies the two-
digit month of the new date object.
intDayFormat
Optional when creating a Lingo date object. An integer that specifies the two-
digit day of the new date object.
month
Optional when creating an JavaScript syntax Date object. A string that specifies the month
of the new Date object. Valid values range from 0 (January) to 11 (December).
dd
Optional when creating an JavaScript syntax Date object. A two-digit integer that specifies the
day of the new Date object. Valid values range from 0 (Sunday) to 6 (Saturday).
yyyy
Optional when creating an JavaScript syntax Date object. A four-digit integer that specifies
the year of the new Date object.
hh
Optional when creating an JavaScript syntax Date object. A two-digit integer that specifies the
hour of the new Date object. Valid values range from 0 (12:00am) to 23 (11:00pm).
mm
Optional when creating an JavaScript syntax Date object. A two-digit integer that specifies the
minute of the new Date object. Valid values range from 0 to 59.
ss
Optional when creating an JavaScript syntax Date object. A two-digit integer that specifies the
seconds of the new Date object. Valid values range from 0 to 59.
yy
Optional when creating an JavaScript syntax Date object. A two-digit integer that specifies the
year of the new Date object. Valid values range from 0 to 99.
milliseconds
Optional when creating an JavaScript syntax Date object. An integer that specifies
the milliseconds of the new Date object. Valid values range from 0 to 999.
Example
These statements create and determine the number of days between two dates:
-- Lingo syntax syntax
myBirthday = date(19650712)
yourBirthday = date(19450529)
put("There are" && abs(yourBirthday - myBirthday) && "days between our \
birthdays.")
// JavaScript syntax
var myBirthday = new Date(1965, 07, 12);
var yourBirthday = new Date(1945, 05, 29);
put("There are " + Math.abs(((yourBirthday - myBirthday)/1000/60/60/24)) +
" days between our birthdays.");
These statements access an individual property of a date:
-- Lingo syntax syntax
myBirthday = date(19650712)
put("I was born in month number" && myBirthday.month)
// JavaScript syntax
var myBirthday = new Date(1965, 07, 12);
put("I was born in month number " + myBirthday.getMonth());
Summary of Contents for DIRECTOR MX 2004-DIRECTOR SCRIPTING
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...