mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-02 17:31:16 +02:00
Shift time zone to GMT to correctly evaluate "current" time.
This commit is contained in:
parent
b776831e8b
commit
98462b73f8
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.33 1997/08/21 23:56:40 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.34 1997/09/01 06:13:21 thomas Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -331,6 +331,7 @@ SetDateTime( DateTime dt) {
|
|||||||
if (DATETIME_IS_CURRENT(dt)) {
|
if (DATETIME_IS_CURRENT(dt)) {
|
||||||
GetCurrentTime(&tt);
|
GetCurrentTime(&tt);
|
||||||
tm2datetime( &tt, 0, NULL, &dt);
|
tm2datetime( &tt, 0, NULL, &dt);
|
||||||
|
dt = dt2local( dt, -CTimeZone);
|
||||||
|
|
||||||
#ifdef DATEDEBUG
|
#ifdef DATEDEBUG
|
||||||
printf( "SetDateTime- current time is %f\n", dt);
|
printf( "SetDateTime- current time is %f\n", dt);
|
||||||
@ -662,6 +663,10 @@ datetime_mi(DateTime *datetime1, DateTime *datetime2)
|
|||||||
if (DATETIME_IS_RELATIVE(dt1)) dt1 = SetDateTime(dt1);
|
if (DATETIME_IS_RELATIVE(dt1)) dt1 = SetDateTime(dt1);
|
||||||
if (DATETIME_IS_RELATIVE(dt2)) dt2 = SetDateTime(dt2);
|
if (DATETIME_IS_RELATIVE(dt2)) dt2 = SetDateTime(dt2);
|
||||||
|
|
||||||
|
#ifdef DATEDEBUG
|
||||||
|
printf( "datetime_mi- evaluate %f - %f\n", dt1, dt2);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (DATETIME_IS_INVALID(dt1)
|
if (DATETIME_IS_INVALID(dt1)
|
||||||
|| DATETIME_IS_INVALID(dt2)) {
|
|| DATETIME_IS_INVALID(dt2)) {
|
||||||
DATETIME_INVALID( result->time);
|
DATETIME_INVALID( result->time);
|
||||||
|
Loading…
Reference in New Issue
Block a user