diff options
author | Bruce Momjian <bruce@momjian.us> | 2007-02-16 03:39:46 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2007-02-16 03:39:46 +0000 |
commit | 4ebb0cf9c30c1e477d5e2dfcc1f2c016c3f8bbcf (patch) | |
tree | fd6ce21ac074478e57b9f55ff378a4ae1a04d14f /src/include/utils/timestamp.h | |
parent | c7b08050d9a2b68b27045b36ff4c9a3db85a55e4 (diff) | |
download | postgresql-4ebb0cf9c30c1e477d5e2dfcc1f2c016c3f8bbcf.tar.gz postgresql-4ebb0cf9c30c1e477d5e2dfcc1f2c016c3f8bbcf.zip |
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
Diffstat (limited to 'src/include/utils/timestamp.h')
-rw-r--r-- | src/include/utils/timestamp.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/include/utils/timestamp.h b/src/include/utils/timestamp.h index 4ff1ffe869e..0d31cc02940 100644 --- a/src/include/utils/timestamp.h +++ b/src/include/utils/timestamp.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/timestamp.h,v 1.66 2007/01/05 22:19:59 momjian Exp $ + * $PostgreSQL: pgsql/src/include/utils/timestamp.h,v 1.67 2007/02/16 03:39:45 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -331,8 +331,11 @@ extern int timestamp_cmp_internal(Timestamp dt1, Timestamp dt2); /* timestamp comparison works for timestamptz also */ #define timestamptz_cmp_internal(dt1,dt2) timestamp_cmp_internal(dt1, dt2) -extern void isoweek2date(int woy, int *year, int *mon, int *mday); +extern int isoweek2j(int year, int week); +extern void isoweek2date(int woy, int *year, int *mon, int *mday); +extern void isoweekdate2date(int isoweek, int isowday, int *year, int *mon, int *mday); extern int date2isoweek(int year, int mon, int mday); extern int date2isoyear(int year, int mon, int mday); +extern int date2isoyearday(int year, int mon, int mday); #endif /* TIMESTAMP_H */ |