GetDateTimePart
getDateTimePart
Returns a part of a specific date
Syntax
getDateTimePart(date, part)
Arguments
date: Is a date with the type of array
part: is an expression with the type of number. It must be one of the built-in constants:
DateTime_Year
DateTime_Month
DateTime_Day
DateTime_Hour
DateTime_Minute
DateTime_Second
DateTime_Millisecond
DateTime_Week
DateTime_TimeZone (only 5.6++)
Return type
number
Examples
number year = getDateTimePart(getDateTime(), DateTime_Year);
print("The current year is " + year);
//Result: The current year is 2011
Availability
Version 4.8