Skip to content

Functions makeDate, makeDateTime, YYYYMMDDToDate, changeYear and similar. #30895

@alexey-milovidov

Description

@alexey-milovidov

Describe solution you'd like:

makeDate(year, month, day)
makeDate32(year, month, day)
makeDateTime(year, month, day, hour, minute, second, [timezone])
makeDateTime64(year, month, day, hour, minute, second, [resolution], [fraction], [timezone])

YYYYMMDDToDate(num)
YYYYMMDDToDate32(num)
YYYYMMDDhhmmssToDateTime(num, [timezone])
YYYYMMDDhhmmssToDateTime64(num, [resolution], [timezone]) -- no fraction arg, it's implicitly extracted from floating point or decimal num.

-- returns the same data type as dt:
changeYear(dt, new_value)
changeMonth(dt, new_value)
changeDay(dt, new_value)

-- if argument is Date - returns DateTime, if Date32, returns DateTime64:
changeHour(dt, new_value)
changeMinute(dt, new_value)
changeSecond(dt, new_value)

Metadata

Metadata

Assignees

Labels

comp-datetimeDate/DateTime/TimeZone datatypes and date-time semantics.featurewarmup taskThe task for new ClickHouse team members. Low risk, moderate complexity, no urgency.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions