mirror of
https://github.com/postgres/postgres.git
synced 2025-11-07 19:06:32 +03:00
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
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/date.c,v 1.112 2005/07/12 15:17:44 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/date.c,v 1.113 2005/07/20 16:42:30 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1423,6 +1423,7 @@ time_interval(PG_FUNCTION_ARGS)
|
||||
result = (Interval *) palloc(sizeof(Interval));
|
||||
|
||||
result->time = time;
|
||||
result->day = 0;
|
||||
result->month = 0;
|
||||
|
||||
PG_RETURN_INTERVAL_P(result);
|
||||
@@ -1477,8 +1478,9 @@ time_mi_time(PG_FUNCTION_ARGS)
|
||||
|
||||
result = (Interval *) palloc(sizeof(Interval));
|
||||
|
||||
result->time = (time1 - time2);
|
||||
result->month = 0;
|
||||
result->day = 0;
|
||||
result->time = time1 - time2;
|
||||
|
||||
PG_RETURN_INTERVAL_P(result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user