1 /*-------------------------------------------------------------------------
4 * PostgreSQL internal timezone library
6 * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
9 * $PostgreSQL: pgsql/src/include/pgtime.h,v 1.11 2005/10/15 02:49:41 momjian Exp $
11 *-------------------------------------------------------------------------
18 * The API of this library is generally similar to the corresponding
19 * C library functions, except that we use pg_time_t which (we hope) is
20 * 64 bits wide, and which is most definitely signed not unsigned.
23 typedef int64 pg_time_t;
31 int tm_mon; /* origin 0, not 1 */
32 int tm_year; /* relative to 1900 */
40 typedef struct pg_tz pg_tz;
42 extern struct pg_tm *pg_localtime(const pg_time_t *timep, const pg_tz *tz);
43 extern struct pg_tm *pg_gmtime(const pg_time_t *timep);
44 extern int pg_next_dst_boundary(const pg_time_t *timep,
45 long int *before_gmtoff,
48 long int *after_gmtoff,
51 extern size_t pg_strftime(char *s, size_t max, const char *format,
52 const struct pg_tm * tm);
54 extern void pg_timezone_initialize(void);
55 extern pg_tz *pg_tzset(const char *tzname);
56 extern bool tz_acceptable(pg_tz *tz);
57 extern const char *pg_get_timezone_name(pg_tz *tz);
59 extern pg_tz *global_timezone;
61 /* Maximum length of a timezone name (not including trailing null) */
62 #define TZ_STRLEN_MAX 255
64 #endif /* _PGTIME_H */