mirror of
https://github.com/postgres/postgres.git
synced 2025-11-03 09:13:20 +03:00
Add two new format fields for use with to_char(), to_date() and
to_timestamp():
- ID for day-of-week
- IDDD for day-of-year
This makes it possible to convert ISO week dates to and from text
fully represented in either week ('IYYY-IW-ID') or day-of-year
('IYYY-IDDD') format.
I have also added an 'isoyear' field for use with extract / date_part.
Brendan Jurd
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.175 2007/01/05 22:19:40 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.176 2007/02/16 03:39:45 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -125,6 +125,7 @@ static const datetkn datetktbl[] = {
|
||||
{"h", UNITS, DTK_HOUR}, /* "hour" */
|
||||
{LATE, RESERV, DTK_LATE}, /* "infinity" reserved for "late time" */
|
||||
{INVALID, RESERV, DTK_INVALID}, /* "invalid" reserved for bad time */
|
||||
{"isoyear", UNITS, DTK_ISOYEAR}, /* year in terms of the ISO week date */
|
||||
{"j", UNITS, DTK_JULIAN},
|
||||
{"jan", MONTH, 1},
|
||||
{"january", MONTH, 1},
|
||||
|
||||
Reference in New Issue
Block a user