Bug #19945 no DATE_FORMAT(date, %Z)
Description:
no easy way to get the timezone from a date field
would like a
%Z alphabetic time zone abbreviation (e.g., EDT)
currently using
mysql> select time_zone_transition_type.Abbreviation from time_zone_transition_type, time_zone_name where time_zone_name.Name='US/Eastern' and time_zone_name.Time_zone_id=time_zone_transition_type.Time_zone_id and time_zone_transition_type.Transition_type_id=(select time_zone_transition.Transition_type_id from time_zone_transition, time_zone_name where time_zone_name.Name='US/Eastern' and time_zone_name.Time_zone_id=time_zone_transition.Time_zone_id and time_zone_transition.Transition_time<UNIX_TIMESTAMP(CONVERT_TZ('2006-04-02 03:00:00', 'US/Eastern', 'UTC')) order by time_zone_transition.Transition_time desc limit 1);
+--------------+
| Abbreviation |
+--------------+
| EST |
+--------------+
1 row in set (0.00 sec)
mysql> select time_zone_transition_type.Abbreviation from time_zone_transition_type, time_zone_name where time_zone_name.Name='US/Eastern' and time_zone_name.Time_zone_id=time_zone_transition_type.Time_zone_id and time_zone_transition_type.Transition_type_id=(select time_zone_transition.Transition_type_id from time_zone_transition, time_zone_name where time_zone_name.Name='US/Eastern' and time_zone_name.Time_zone_id=time_zone_transition.Time_zone_id and time_zone_transition.Transition_time<UNIX_TIMESTAMP(CONVERT_TZ('2006-04-02 03:00:01', 'US/Eastern', 'UTC')) order by time_zone_transition.Transition_time desc limit 1);
+--------------+
| Abbreviation |
+--------------+
| EDT |
+--------------+
How to repeat:
feature request
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.051 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.
Description: no easy way to get the timezone from a date field would like a %Z alphabetic time zone abbreviation (e.g., EDT) currently using mysql> select time_zone_transition_type.Abbreviation from time_zone_transition_type, time_zone_name where time_zone_name.Name='US/Eastern' and time_zone_name.Time_zone_id=time_zone_transition_type.Time_zone_id and time_zone_transition_type.Transition_type_id=(select time_zone_transition.Transition_type_id from time_zone_transition, time_zone_name where time_zone_name.Name='US/Eastern' and time_zone_name.Time_zone_id=time_zone_transition.Time_zone_id and time_zone_transition.Transition_time<UNIX_TIMESTAMP(CONVERT_TZ('2006-04-02 03:00:00', 'US/Eastern', 'UTC')) order by time_zone_transition.Transition_time desc limit 1); +--------------+ | Abbreviation | +--------------+ | EST | +--------------+ 1 row in set (0.00 sec) mysql> select time_zone_transition_type.Abbreviation from time_zone_transition_type, time_zone_name where time_zone_name.Name='US/Eastern' and time_zone_name.Time_zone_id=time_zone_transition_type.Time_zone_id and time_zone_transition_type.Transition_type_id=(select time_zone_transition.Transition_type_id from time_zone_transition, time_zone_name where time_zone_name.Name='US/Eastern' and time_zone_name.Time_zone_id=time_zone_transition.Time_zone_id and time_zone_transition.Transition_time<UNIX_TIMESTAMP(CONVERT_TZ('2006-04-02 03:00:01', 'US/Eastern', 'UTC')) order by time_zone_transition.Transition_time desc limit 1); +--------------+ | Abbreviation | +--------------+ | EDT | +--------------+ How to repeat: feature request