]> Savannah Git Hosting - gnulib.git/commit
parse-datetime: fix local timezone debug messages
authorAssaf Gordon <assafgordon@gmail.com>
Thu, 5 Jan 2017 04:19:51 +0000 (23:19 -0500)
committerAssaf Gordon <assafgordon@gmail.com>
Thu, 5 Jan 2017 05:08:07 +0000 (00:08 -0500)
commitc56e7fbb0321a78dfb66dc0fb797e8be5aa91fc7
treeab5d077c1166f8ae335e5cee718e748b960c8110
parent30a55dd72dad2fd3a92f62dbfef4afd7ec72e540
parse-datetime: fix local timezone debug messages

"Local timezones" are strings that affect only DST relative to the
default timezone. The debug messages in parse-datetime.y printed
wrong information when encountering local timezones.

Examples:
Here EET/EEST are time zones ('zone' token, with values +02:00/+03:00):
     TZ=Asia/Tokyo ./src/date --debug -d '2011-12-11 EET'
     TZ=Asia/Tokyo ./src/date --debug -d '2011-06-11 EEST'

When the default timezone relates to the zone strings, EET/EEST are
parsed as local timezones (tLOCAL_ZONE), and only change the DST
value (0/1, respectively):
     TZ=Europe/Helsinki ./src/date --debug -d '2011-12-11 EET'
     TZ=Europe/Helsinki ./src/date --debug -d '2011-06-11 EEST'

* lib/parse-datetime.y (debug_print_current_time): If local timezone was
seen, inform about DST change, don't print actual timezone.
(debug_strfdatetime): If local timezone was seen, use default timezone
(and adjust as needed) instead of using incorrect timezone.
(parse_datetime2): Use correct time-zone source string, and adjust
default timezone as needed.
ChangeLog
lib/parse-datetime.y