3 Every date in RT's DB is stored in UTC format. This affects charts
4 grouped by time periods (Annually, Monthly, etc.). To produce
5 charts that are in a specific timezone we have to use database specific
6 functions to convert time. Each DB has very different requirements.
10 This code is experimental and you can turn it on and off using
11 boolean option $ChartsTimezonesInDB in the RT config.
13 =head1 DATABASE SPECIFIC NOTES
17 Time can not just be converted using numeric time shift as this
18 shift value depends on daylight saving time properties of the time zone.
20 mysql since 4.1.3 supports named timezones, but you have to fill
21 special tables with up to date data. On modern systems it's Usually
24 mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql
26 mysql's doc recommends to restart server. Read more about timezones
27 in mysql in the following document
28 http://dev.mysql.com/doc/refman/5.0/en/time-zone-support.html .
32 PostgreSQL database uses your operating system's functions to convert
33 timezones. You don't need to do anything in particular except making
34 sure that the data in F</usr/share/zoneinfo> is up to date. On some
35 systems this means upgrading a system package.
37 =head3 Note for users of Pg 7.2 and older or users upgraded from those
39 You should be sure that timestamps in RT DB have no TZ set. TIMESTAMP
40 column type in PostgreSQL prior to Pg 7.3 has timezone info by default.
41 In newer versions it's not the case anymore. If your RT database has
42 this embedded timezone info, you need to alter the columns before
43 enabling this feature.
45 =head2 Other databases
47 There is no implementation for other DBs, yet.
53 We use timestamp type for all datetime fields. It either has timezone
54 info or not, by default since Pg 7.3 it has no timezone. Conversion is
57 timezone('Europe/Moscow', timezone('UTC', column_without_tz_info))
58 timezone('to_tz', timezone('from_tz', column_without_tz_info))
59 http://www.postgresql.org/docs/7.4/static/functions-datetime.html#FUNCTIONS-DATETIME-ZONECONVERT
61 This function flips HAS_TZ flag on the argument. First call makes
62 no conversion, but flips HAS_TZ flag. So next call flips it back
63 and does actual conversion.
65 http://www.postgresql.org/docs/7.4/static/datatype-datetime.html#DATATYPE-TIMEZONES
69 Once timezone information is loaded into tables on the server,
70 we have all the same set of named timezones in the system
71 and DateTime (DateTime project has copy of the TZ data in a module).
73 CONVERT_TZ(TS, from, to) exists since mysql 4.1.3. Note that it
74 takes timestamp, so supports limitted range (usuall 1970-2038).
78 Look at FROM_TZ function.
82 As far as I can see has no support.