1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-16 06:01:02 +03:00

- new to_char(interval, text)

- new millisecond (ms) and microsecond (us) support
 - more robus parsing from string - used is separator checking for
   non-exact formats like to_date('2001-9-1', 'YYYY-MM-DD')
 - SGML docs are included

Karel Zak
This commit is contained in:
Bruce Momjian
2001-09-06 03:22:42 +00:00
parent 74dde13e2c
commit 2a34134b6c
6 changed files with 477 additions and 308 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.49 2001/05/03 22:53:07 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.50 2001/09/06 03:22:42 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -33,9 +33,6 @@ static double time2t(const int hour, const int min, const double sec);
static int EncodeSpecialTimestamp(Timestamp dt, char *str);
static Timestamp dt2local(Timestamp dt, int timezone);
static void dt2time(Timestamp dt, int *hour, int *min, double *sec);
static int interval2tm(Interval span, struct tm * tm, float8 *fsec);
static int tm2interval(struct tm * tm, double fsec, Interval *span);
/*****************************************************************************
* USER I/O ROUTINES *
@ -412,7 +409,7 @@ tm2timestamp(struct tm * tm, double fsec, int *tzp, Timestamp *result)
/* interval2tm()
* Convert a interval data type to a tm structure.
*/
static int
int
interval2tm(Interval span, struct tm * tm, float8 *fsec)
{
double time;
@ -444,7 +441,7 @@ interval2tm(Interval span, struct tm * tm, float8 *fsec)
return 0;
} /* interval2tm() */
static int
int
tm2interval(struct tm * tm, double fsec, Interval *span)
{
span->month = ((tm->tm_year * 12) + tm->tm_mon);