Time Zones¶
The ChartFactor Toolkit allows to convert time data into different time zones if the provider being used supports it. If it does, we can configure at metadata level the time zone we want to use for all time fields or for specific ones. From that moment on, these fields will be translated to that time zone to be displayed on the visuals.
Before moving forward, check the Provider's capabilities table to know what providers include time zone support.
Time zone conversions are applied over fields of type TIME as long as the field has date and time information. This means fields with original type datetime
or timestamp
depending on the provider.
Note
To avoid time zone conversion conflicts, we recommend that datetime data is stored as UTC.
Default mode¶
By default, no timezone will be used, and all values coming from the data source will be considered as UTC. That's why we recommend that time field values should be stored as UTC.
Configuring time zones¶
Time zones can be configured in two ways within the metadata: at source level and at field level. At source level the conversion will be applied to every TIME field that allows it. If it is defined at field level, that's the one that will be used even though there's another timezone defined at source level.
Let's consider that we have this visualization:
And we want to display the data in Tokyo time:
1 2 3 4 5 6 |
|
The result will be this one:
We can notice two things here: The first one is that we have defined Asia/Tokyo
as a time zone, so it just added 9 hours to the data displayed (UTC+9). So every value was shifted to use that time. The second thing is that now the field label contains the abbreviation, which is JST for this case.
Let's say now that we want to use the Asia/Tokyo time zone for all time fields except for saletime for which we'd like to use Europe/Amsterdam
(UTC+1) instead.
1 2 3 4 5 6 7 8 9 10 11 |
|
In the code above, we don't remove the source level time zone, but we add a new one at field level only for the saletime field. The result will be like:
Local time zone¶
If we want to convert the data into local time dynamically depending on the users location, then we can use the time zone keyword Local
in the metadata definition. For example, if we configure the source time zone to Local
and we open the browser in New York, ChartFactor will use America/New_York
as a time zone.
Supported time zones¶
Here is the full list of time zones currently supported by ChartFactor:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
|