|
|
static DUCKDB_API date_t | FromString (const string &str, bool strict=false) |
| | Convert a string in the format "YYYY-MM-DD" to a date object.
|
| |
|
static DUCKDB_API date_t | FromCString (const char *str, idx_t len, bool strict=false) |
| | Convert a string in the format "YYYY-MM-DD" to a date object.
|
| |
|
static DUCKDB_API string | ToString (date_t date) |
| | Convert a date object to a string in the format "YYYY-MM-DD".
|
| |
| static DUCKDB_API bool | TryConvertDateSpecial (const char *buf, idx_t len, idx_t &pos, const DateSpecial &special) |
| |
| static DUCKDB_API DateCastResult | TryConvertDate (const char *buf, idx_t len, idx_t &pos, date_t &result, bool &special, bool strict=false) |
| |
| static DUCKDB_API string | Format (int32_t year, int32_t month, int32_t day) |
| |
|
static DUCKDB_API void | Convert (date_t date, int32_t &out_year, int32_t &out_month, int32_t &out_day) |
| | Extract the year, month and day from a given date object.
|
| |
|
static DUCKDB_API date_t | FromDate (int32_t year, int32_t month, int32_t day) |
| | Create a Date object from a specified (year, month, day) combination.
|
| |
|
static DUCKDB_API bool | TryFromDate (int32_t year, int32_t month, int32_t day, date_t &result) |
| |
|
static DUCKDB_API bool | IsLeapYear (int32_t year) |
| | Returns true if (year) is a leap year, and false otherwise.
|
| |
| static DUCKDB_API bool | IsValid (int32_t year, int32_t month, int32_t day) |
| |
| static bool | IsFinite (date_t date) |
| | Returns true if the specified date is finite.
|
| |
|
static DUCKDB_API int32_t | MonthDays (int32_t year, int32_t month) |
| | The max number of days in a month of a given year.
|
| |
|
static DUCKDB_API int64_t | Epoch (date_t date) |
| | Extract the epoch from the date (seconds since 1970-01-01)
|
| |
|
static DUCKDB_API int64_t | EpochNanoseconds (date_t date) |
| | Extract the epoch from the date (nanoseconds since 1970-01-01)
|
| |
|
static DUCKDB_API int64_t | EpochMicroseconds (date_t date) |
| | Extract the epoch from the date (microseconds since 1970-01-01)
|
| |
|
static DUCKDB_API int64_t | EpochMilliseconds (date_t date) |
| | Extract the epoch from the date (milliseconds since 1970-01-01)
|
| |
|
static DUCKDB_API date_t | EpochToDate (int64_t epoch) |
| | Convert the epoch (seconds since 1970-01-01) to a date_t.
|
| |
|
static DUCKDB_API int32_t | EpochDays (date_t date) |
| | Extract the number of days since epoch (days since 1970-01-01)
|
| |
|
static DUCKDB_API date_t | EpochDaysToDate (int32_t epoch) |
| | Convert the epoch number of days to a date_t.
|
| |
|
static DUCKDB_API int32_t | ExtractYear (date_t date) |
| | Extract year of a date entry.
|
| |
|
static DUCKDB_API int32_t | ExtractMonth (date_t date) |
| | Extract month of a date entry.
|
| |
|
static DUCKDB_API int32_t | ExtractDay (date_t date) |
| | Extract day of a date entry.
|
| |
|
static DUCKDB_API int32_t | ExtractISODayOfTheWeek (date_t date) |
| | Extract the day of the week (1-7)
|
| |
|
static DUCKDB_API int32_t | ExtractDayOfTheYear (date_t date) |
| | Extract the day of the year.
|
| |
|
static DUCKDB_API int64_t | ExtractJulianDay (date_t date) |
| | Extract the day of the year.
|
| |
| static DUCKDB_API void | ExtractISOYearWeek (date_t date, int32_t &year, int32_t &week) |
| |
|
static DUCKDB_API int32_t | ExtractISOWeekNumber (date_t date) |
| |
|
static DUCKDB_API int32_t | ExtractISOYearNumber (date_t date) |
| |
| static DUCKDB_API int32_t | ExtractWeekNumberRegular (date_t date, bool monday_first=true) |
| |
|
static DUCKDB_API date_t | GetMondayOfCurrentWeek (date_t date) |
| | Returns the date of the monday of the current week.
|
| |
|
static DUCKDB_API bool | ParseDoubleDigit (const char *buf, idx_t len, idx_t &pos, int32_t &result) |
| | Helper function to parse two digits from a string (e.g. "30" -> 30, "03" -> 3, "3" -> 3)
|
| |
|
static DUCKDB_API string | FormatError (const string &str) |
| |
|
static DUCKDB_API string | FormatError (string_t str) |
| |
|
static DUCKDB_API string | RangeError (const string &str) |
| |
|
static DUCKDB_API string | RangeError (string_t str) |
| |
The Date class is a static class that holds helper functions for the Date type.