From 4ebb0cf9c30c1e477d5e2dfcc1f2c016c3f8bbcf Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Fri, 16 Feb 2007 03:39:46 +0000 Subject: 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 --- src/include/utils/timestamp.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/include/utils/timestamp.h') diff --git a/src/include/utils/timestamp.h b/src/include/utils/timestamp.h index 4ff1ffe869..0d31cc0294 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 */ -- cgit v1.2.1