-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
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 monthdate_replace("2020-05-13", 1, "day") -> "2020-05-01"date_get(date, unit) -> value- get a part of a date, e.g. get the yeardate_get("2020-05-13", "year") -> 2020or get the daydate_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.
Reactions are currently unavailable