Sets the year component of the given DateTime.

Syntax

Smartsite SXML CopyCode image Copy Code
datetime datetime.setyear(datetime dt, integer year)

Parameters

Name Data Type Description
dt DateTime A DateTime.
year Integer The year (1 through 9999).

Return Value

Data Type Description
DateTime A new DateTime with the same component values as the given DateTime, except for the year component which is set to the given value.

Expand image Example

SXML