Mysql
 sql >> Base de Dados >  >> RDS >> Mysql

MySQL:Como selecionar o deslocamento UTC e DST para todos os fusos horários?


Tente esta consulta. O tempo de deslocamento é o (Offset / 60 / 60)
SELECT tzname.`Time_zone_id`,(`Offset`/60/60) AS `offsettime`,`Is_DST`,`Name`,`Transition_type_id`,`Abbreviation`
FROM `time_zone_transition_type` AS `transition`, `time_zone_name` AS `tzname`
WHERE transition.`Time_zone_id`=tzname.`Time_zone_id`
ORDER BY transition.`Offset` ASC;

Os resultados são
501 -12.00000000    0   0   PHOT    Pacific/Enderbury
369 -12.00000000    0   0   GMT+12  Etc/GMT+12
513 -12.00000000    0   1   KWAT    Pacific/Kwajalein
483 -12.00000000    0   1   KWAT    Kwajalein
518 -11.50000000    0   1   NUT Pacific/Niue
496 -11.50000000    0   1   SAMT    Pacific/Apia
528 -11.50000000    0   1   SAMT    Pacific/Samoa
555 -11.50000000    0   1   SAMT    US/Samoa
521 -11.50000000    0   1   SAMT    Pacific/Pago_Pago
496 -11.44888889    0   0   LMT Pacific/Apia
528 -11.38000000    0   0   LMT Pacific/Samoa
555 -11.38000000    0   0   LMT US/Samoa
521 -11.38000000    0   0   LMT Pacific/Pago_Pago
518 -11.33333333    0   0   NUT Pacific/Niue
544 -11.00000000    0   3   BST US/Aleutian
163 -11.00000000    0   3   BST America/Nome
518 -11.00000000    0   2   NUT Pacific/Niue
496 -11.00000000    0   2   WST Pacific/Apia
544 -11.00000000    0   0   NST US/Aleutian
163 -11.00000000    0   0   NST America/Nome
528 -11.00000000    0   4   SST Pacific/Samoa
528 -11.00000000    0   3   BST Pacific/Samoa