aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/pgtime.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/include/pgtime.h b/src/include/pgtime.h
index 28bd27e7f79..92350527f65 100644
--- a/src/include/pgtime.h
+++ b/src/include/pgtime.h
@@ -22,14 +22,21 @@
typedef int64 pg_time_t;
+/*
+ * CAUTION: the IANA timezone library (src/timezone/) follows the POSIX
+ * convention that tm_mon counts from 0 and tm_year is relative to 1900.
+ * However, Postgres' datetime functions generally treat tm_mon as counting
+ * from 1 and tm_year as relative to 1 BC. Be sure to make the appropriate
+ * adjustments when moving from one code domain to the other.
+ */
struct pg_tm
{
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
- int tm_mon; /* origin 1, not 0! */
- int tm_year; /* relative to 1900 */
+ int tm_mon; /* see above */
+ int tm_year; /* see above */
int tm_wday;
int tm_yday;
int tm_isdst;