This version is out of date, covering development from v8.0.0 to v8.x.x. It is maintained here only for inbound reference links from elsewhere. It is no longer actively updated.

Jump to the current version of aTbRef

Tinderbox v8 Icon

date(year,month,day,[hour,min])


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Operator First Added: 

Operator Altered: 

 Function   [other Function type actions]

 Item   [operators of similar scope]

 Date-time   [other Date-time operators]

 Baseline

 


date(year,month,day[,hour,min])

constructs a Date from individual numeric elements. This is useful, for example, if you need to assemble a date from separate attributes.

year is the 4-digit year

month is a number from 1–12

day is a number from 1 to 31

The time arguments are optional, and are specified in a 24-hour clock.

hour is a number from 0 to 23

minute is a number from 0 to 59

Using this operator, do not quote the whole argument list: these should be left as individual numbers.

Wrong: $MyDate = date("2004,7,23,16,45"); 

Right: $MyDate = date(2004,7,23,16,45); 

Examples:

$MyDate = date(2004,7,23,16,45); …sets 23 July 2004 16:45