@Month (JavaScript)

Returns the month from a date and time.

Defined in

@Functions (JavaScript)

Syntax

@Month(time:Date) : int
Parameter Description
time A date and time.
Return value Description
int The month of the date and time.

Examples

This example constructs a date and time 24 hours before the current time by using the date from @Yesterday and the time from @Now.
function p(stuff) {
	print("<<<" + stuff + ">>>");
}

var date1 = @Yesterday();
var year = @Year(date1);
var month = @Month(date1);
var day = @Day(date1);
var date2 = @Now();
var hour = @Hour(date2);
var minute = @Minute(date2);
var second = @Second(date2);
var yesterday = @Date(year, month, day, hour, minute, second);
p("24 hours ago = " + yesterday.toLocaleString());