rnkdate — convert a date value to the first day of the month
date
rnkdate
(
|
dateval) ; |
date
dateval
;
timestamp
rnkdate
(
|
dateval) ; |
timestamp
dateval
;A function which returns a date that is the first day of the month of a given date value.
This function is similar to the
date_trunc('month', date)
function, but takes
care of data type conversions and handles time zones. The
postgresql date_trunc()
function expects a
timestamp
or timestamptz
data
type as input. This can lead to confusion involving time
zones.
Always use the rnkdate()
function
when comparing a date with a RANKS.Rnkdate value.
Unless care is taken, use of the Postgresql
date_trunc()
function can lead to
mis-matches due to time zone complications.
While it may well be possible to use the
date_trunc()
function in place of the
rnkdate()
function; the possibility of
complications due to time zone issues has not been
thoroughly investigated. Better safe than sorry.