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

Commitd8a266c

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 parent9f9ae01 commitd8a266c

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
@@ -2832,6 +2832,8 @@ timetz_zone(PG_FUNCTION_ARGS)
28322832
structpg_tm*tm;
28332833

28342834
tm=pg_localtime(&now,tzp);
2835+
tm->tm_year+=1900;/* adjust to PG conventions */
2836+
tm->tm_mon+=1;
28352837
tz=DetermineTimeZoneAbbrevOffset(tm,tzname,tzp);
28362838
}
28372839
else

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp