Skip to content

Date replace and/or get processes #254

@m-mohr

Description

@m-mohr

After we've added date_shift, there are some more options that seem obviously useful:

  • date_replace(date, value, unit) -> date - replace parts of a date, e.g. set a date to the first of a month date_replace("2020-05-13", 1, "day") -> "2020-05-01"
  • date_get(date, unit) -> value - get a part of a date, e.g. get the year date_get("2020-05-13", "year") -> 2020 or get the day date_get("2020-05-13", "day") -> 13 (name could also be date_element in accordance to array_element? 😅)

With date_get and date_shift one could emulate date_replace to some degree, but not fully (e.g. can't do the "snap" behavior) so they have both their use cases.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions