Add beginning_X/0 variations

This commit is contained in:
Jesse Gumm 2015-11-07 11:39:24 -06:00
parent 6ca6037f29
commit d73a31e664
2 changed files with 29 additions and 3 deletions

View file

@ -621,9 +621,11 @@ ok
## Date Truncation (Beginning of X)
Sometimes you need to truncate a time (say, the beginning of the current month).
Sometimes you need to truncate a time (say, the beginning of the current
month).
This is abstracted to `beginning_X` functions, which return a date/time format with the dates and times truncated to the specified level.
This is abstracted to `beginning_X` functions, which return a date/time format
with the dates and times truncated to the specified level.
+ `beginning_minute(Date)`
+ `beginning_hour(Date)`
@ -631,6 +633,10 @@ This is abstracted to `beginning_X` functions, which return a date/time format w
+ `beginning_month(Date)`
+ `beginning_year(Date)`
There are also 0-arity versions of the above, in which `Date` is assumed to be
"right now". For example, calling `qdate:beginning_month()` would return
midnight on the first day of the current month.
## Date Arithmetic
The current implementation of qdate's date arithmetic returns Unixtimes.