tumblr tracker

GetMonth

Library Reference ›› DateTime ››
Parent Previous Next

DateTime.GetMonth


Namespace: DateTime


Returns the month value from a datetime variable.


retval = DateTime.GetMonth(DateTime)


Parameters:

- DateTime; datetime variable or function call returning datetime variable; the datetime value to extract the month from


Returns:

Value between 1 and 12; numeric value.


Example


$val = DateTime.GetMonth(DateTime.GetCurrentDateTime());


After execution the $val variable will contain the current month (1 to 12).