diff options
| author | Bruce Momjian | 2005-07-20 16:42:32 +0000 |
|---|---|---|
| committer | Bruce Momjian | 2005-07-20 16:42:32 +0000 |
| commit | db05f4a7eb6c80c67c25ca9d28be825b99ed3553 (patch) | |
| tree | dee67dee9058a0243609c838c6be521143d23f3b /src/interfaces | |
| parent | 826604f9e61c233c4229a3eb4d1ee3945691ee1b (diff) | |
Add 'day' field to INTERVAL so 1 day interval can be distinguished from
24 hours. This is very helpful for daylight savings time:
select '2005-05-03 00:00:00 EST'::timestamp with time zone + '24 hours';
?column?
----------------------
2005-05-04 01:00:00-04
select '2005-05-03 00:00:00 EST'::timestamp with time zone + '1 day';
?column?
----------------------
2005-05-04 01:00:00-04
Michael Glaesemann
Diffstat (limited to 'src/interfaces')
| -rw-r--r-- | src/interfaces/ecpg/pgtypeslib/interval.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/interfaces/ecpg/pgtypeslib/interval.c b/src/interfaces/ecpg/pgtypeslib/interval.c index 4871bdeeab4..0f0eb8be165 100644 --- a/src/interfaces/ecpg/pgtypeslib/interval.c +++ b/src/interfaces/ecpg/pgtypeslib/interval.c @@ -33,7 +33,7 @@ TrimTrailingZeros(char *str) * can be used to represent time spans. */ static int -DecodeTime(char *str, int fmask, int *tmask, struct tm * tm, fsec_t *fsec) +DecodeTime(char *str, int fmask, int *tmask, struct tm *tm, fsec_t *fsec) { char *cp; @@ -107,7 +107,7 @@ DecodeTime(char *str, int fmask, int *tmask, struct tm * tm, fsec_t *fsec) * preceding an hh:mm:ss field. - thomas 1998-04-30 */ int -DecodeInterval(char **field, int *ftype, int nf, int *dtype, struct tm * tm, fsec_t *fsec) +DecodeInterval(char **field, int *ftype, int nf, int *dtype, struct tm *tm, fsec_t *fsec) { int is_before = FALSE; @@ -445,7 +445,7 @@ DecodeInterval(char **field, int *ftype, int nf, int *dtype, struct tm * tm, fse * - thomas 1998-04-30 */ int -EncodeInterval(struct tm * tm, fsec_t fsec, int style, char *str) +EncodeInterval(struct tm *tm, fsec_t fsec, int style, char *str) { int is_before = FALSE; int is_nonzero = FALSE; @@ -670,7 +670,7 @@ EncodeInterval(struct tm * tm, fsec_t fsec, int style, char *str) * Convert a interval data type to a tm structure. */ static int -interval2tm(interval span, struct tm * tm, fsec_t *fsec) +interval2tm(interval span, struct tm *tm, fsec_t *fsec) { #ifdef HAVE_INT64_TIMESTAMP int64 time; @@ -713,7 +713,7 @@ interval2tm(interval span, struct tm * tm, fsec_t *fsec) } /* interval2tm() */ static int -tm2interval(struct tm * tm, fsec_t fsec, interval *span) +tm2interval(struct tm *tm, fsec_t fsec, interval *span) { span->month = tm->tm_year * 12 + tm->tm_mon; #ifdef HAVE_INT64_TIMESTAMP |
