mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
From: Thomas Lockhart <Thomas.G.Lockhart@jpl.nasa.gov>
Subject: Re: [HACKERS] abstime "now" broken Yes, I broke 'now' :( with an attempt at a bug fix involving servers running in the UTC/GMT timezone. These patches fix the problem, and have been tested in GMT (+00 hours), PST (-08), and NZT (+12) timezones which exercized the code for various cases including across day boundaries. btw, this code fixes the same type of problem for 'today', 'yesterday', 'tomorrow', for DATETIME, ABSTIME, DATE and TIME types. The bugfix itself is quite small, but I have accumulated other changes in the datetime data type and include them here also. One set of changes involves printing ISO-formatted dates and is in response to the helpful information from Kurt Lidl regarding ANSI SQL dates. I'll send another e-mail sometime soon discussing more issues he has raised...
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.20 1997/03/28 06:54:51 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.21 1997/03/28 07:12:53 scrappy Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -93,7 +93,7 @@ GetCurrentTime(struct tm *tm)
|
||||
time_t now;
|
||||
struct tm *tt;
|
||||
|
||||
now = GetCurrentTransactionStartTime();
|
||||
now = GetCurrentTransactionStartTime()-CTimeZone;
|
||||
tt = gmtime( &now);
|
||||
|
||||
tm->tm_year = tt->tm_year+1900;
|
||||
|
Reference in New Issue
Block a user