TimeUnits
Provides the BIF and member functions for all time unit request with no arguments
Method Signature
TimeUnits(date=[any], timezone=[string], locale=[string])
Arguments
Argument
Type
Required
Description
Default
date
any
false
The date object to be evaluated. If not provided the current date and time is used
timezone
string
false
An optional timezone which to convert the date object to
locale
string
false
An optional ISO locale string which will return the specified time unit with a locale-specific result ( e.g. month name, or starting day of week as Monday vs Sunda )
Examples
Year of a datetime object
dt = createdatetime( 2016, 1, 1, 5, 30, 25 );
y = year( dt );
writeoutput( y );
Result: 2016
Additional Examples
thisYear = year( now() );
dump( thisYear );
Related
Last updated
Was this helpful?