EasyManua.ls Logo

MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING - Page 283

MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING
1130 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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());

Related product manuals