Date Rules
Date
values are encoded in data table files using Khiops native format YYYY-MM-DD
. Other formats
are available, that allow to convert categorical values to date values.
YYYY-MM-DD |
YYYY/MM/DD |
YYYY.MM.DD |
YYYYMMDD |
DD-MM-YYYY |
DD/MM/YYYY |
DD.MM.YYYY |
DDMMYYYY |
YYYY-DD-MM |
YYYY/DD/MM |
YYYY.DD.MM |
YYYYDDMM |
MM-DD-YYYY |
MM/DD/YYYY |
MM.DD.YYYY |
MMDDYYYY |
Valid dates range from 0001-01-01
to 4000-12-31
, with validity according to Gregorian calendar.
Date
rules return a missing value when their date operand is not valid or when a numerical operand
is missing.
FormatDate
Format a date into a categorical value using a date format. Date format is a categorical constant
value among the available date formats (for example: YYYY-MM-DD
).
AsDate
Recode a categorical value into a date using a date format.
Year
Year in a date value.
Month
Month in a date value.
Day
Day in a date value.
YearDay
Day in year in a date value.
WeekDay
Day in week in a date value.
Returns 1 for Monday, 2 for Tuesday ..., 7 for Sunday.
DecimalYear
Year in a date value, with decimal part for day in year.
AbsoluteDay
Total elapsed days since 2000-01-01
.
DiffDate
Difference in days between two date values.
AddDays
Adds a number of days to a date value.
IsDateValid
Checks if a date value is valid.
BuildDate
Builds a date value from year, month and day.
The year must be between 1 and 9999. The month must be between 1 and 12. The day must be between 1 and 31, and consistent with the month and year.