Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit599c73a

Browse files
committed
Fix bogus timetz_zone() results for DYNTZ abbreviations.
timetz_zone() delivered completely wrong answers if the zone wasspecified by a dynamic TZ abbreviation, because it failed to accountfor the difference between the POSIX conventions for field values instruct pg_tm and the conventions used in PG-specific datetime code.As a stopgap fix, just adjust the tm_year and tm_mon fields to matchPG conventions. This is fixed in a different way in HEAD (388e71a)but I don't want to back-patch the change of reference point.Discussion:https://postgr.es/m/CAJ7c6TOMG8zSNEZtCn5SPe+cCk3Lfxb71ZaQwT2F4T7PJ_t=KA@mail.gmail.com
1 parent1e9afc8 commit599c73a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎src/backend/utils/adt/date.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3073,6 +3073,8 @@ timetz_zone(PG_FUNCTION_ARGS)
30733073
structpg_tm*tm;
30743074

30753075
tm=pg_localtime(&now,tzp);
3076+
tm->tm_year+=1900;/* adjust to PG conventions */
3077+
tm->tm_mon+=1;
30763078
tz=DetermineTimeZoneAbbrevOffset(tm,tzname,tzp);
30773079
}
30783080
else

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp