Skip to content

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
let customMeta = {
    'ticket_sales': {
        'tz': 'Asia/Tokyo', 
        'fields': { }
    }
}

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
let customMeta = {
    'ticket_sales': {
        'tz': 'Asia/Tokyo', 
        'fields': {
            'saletime': { 
                'label': 'Sale time',
                'tz': 'Europe/Amsterdam'
                }
        }
    }
}

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
[
"Africa/Cairo"
"Africa/Johannesburg"
"America/Argentina/Buenos_Aires"
"America/Bogota",       
"America/Caracas",      
"America/Panama",
"America/Chicago",      
"America/Costa_Rica",                       
"America/Denver",
"America/Detroit",      
"America/El_Salvador",      
"America/Fort_Nelson",
"America/Fort_Wayne",                   
"America/Guatemala",
"America/Guayaquil",    
"America/Indiana/Knox",     
"America/Jamaica",      
"America/Kentucky/Louisville",      
"America/La_Paz",
"America/Lima",
"America/Los_Angeles",      
"America/Managua",              
"America/Mexico_City",      
"America/Montevideo",
"America/Toronto",      
"America/New_York",             
"America/North_Dakota/Center",      
"America/Phoenix",      
"America/Puerto_Rico",      
"America/Santo_Domingo",
"America/Sao_Paulo",                
"America/Tegucigalpa",      
"America/Vancouver",        
"Europe/Oslo",
"Asia/Riyadh",
"Asia/Qatar",       
"Asia/Bangkok",     
"Asia/Beirut",      
"Asia/Brunei",              
"Asia/Shanghai",        
"Asia/Damascus",        
"Asia/Dubai",       
"Asia/Ho_Chi_Minh",
"Asia/Hong_Kong",       
"Europe/Istanbul",
"Asia/Jakarta",     
"Asia/Jerusalem",
"Asia/Kabul",       
"Asia/Kuala_Lumpur",        
"Asia/Manila",      
"Asia/Seoul",
"Asia/Singapore",
"Asia/Taipei",
"Asia/Tehran",
"Asia/Tokyo",       
"Atlantic/South_Georgia",
"Australia/Sydney", 
"CET",
"CST6CDT",
"EET",
"EST",
"EST5EDT",
"Pacific/Easter",               
"Europe/Dublin",        
"Etc/GMT-0",
"Etc/GMT-1",
"Etc/GMT-10",
"Etc/GMT-11",
"Etc/GMT-12",
"Etc/GMT-13",
"Etc/GMT-14",
"Etc/GMT-2",
"Etc/GMT-3",
"Etc/GMT-4",
"Etc/GMT-5",
"Etc/GMT-6",
"Etc/GMT-7",
"Etc/GMT-8",
"Etc/GMT-9",
"Etc/GMT+1",
"Etc/GMT+10",
"Etc/GMT+11",
"Etc/GMT+12",
"Etc/GMT+2",
"Etc/GMT+3",
"Etc/GMT+4",
"Etc/GMT+5",
"Etc/GMT+6",
"Etc/GMT+7",
"Etc/GMT+8",
"Etc/GMT+9",
"Etc/UCT",
"Etc/UTC",
"Europe/Amsterdam",     
"Europe/Athens",
"Europe/London",        
"Europe/Berlin",
"Europe/Prague",
"Europe/Brussels",      
"Europe/Budapest",
"Europe/Zurich",
"Europe/Copenhagen",
"Europe/Gibraltar",
"Europe/Helsinki",      
"Europe/Lisbon",
"Europe/Luxembourg",
"Europe/Madrid",
"Europe/Malta",
"Europe/Minsk",     
"Europe/Moscow",
"Europe/Paris",
"Europe/Rome",
"Europe/Sofia",
"Europe/Stockholm",
"Europe/Vienna",
"HST",      
"MET",
"MST",
"MST7MDT",
"Pacific/Galapagos",
"Pacific/Honolulu",
"PST8PDT",
"WET"
]