Sets the date components of the given DateTime.

Syntax

Smartsite SXML CopyCode image Copy Code
datetime datetime.setdate(datetime dt, integer year, integer month, integer day)

Parameters

Name Data Type Description
dt DateTime A DateTime.
year Integer The year (1 through 9999).
month Integer The month (1 through 12).
day Integer The day (1 through the number of days in the given month).

Return Value

Data Type Description
DateTime A new DateTime with the same time as the given DateTime, and the date set to the given date component values.

Expand image Example

SXML