Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 635982 - <sys-apps/coreutils-8.27: date: conversion from one timezone to another TZ no longer works
Summary: <sys-apps/coreutils-8.27: date: conversion from one timezone to another TZ no...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-31 06:04 UTC by Ian Zimmerman
Modified: 2017-11-06 14:04 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Zimmerman 2017-10-31 06:04:00 UTC
On a debian stable system:

 ahiker!1 itz$ cat /etc/timezone 
America/Los_Angeles
 ahiker!2 itz$ date
Mon Oct 30 23:00:18 PDT 2017
 ahiker!3 itz$ date -d 'TZ="Europe/Prague" 2017-10-31 15:45' +'%H%M %m/%d/%Y'
0745 10/31/2017
 ahiker!4 itz$ date --version
date (GNU coreutils) 8.26
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David MacKenzie.

But on a current "stable" gentoo system:

 matica!17 ~$ cat /etc/timezone
America/Los_Angeles
 matica!18 ~$ date
Mon Oct 30 23:02:11 PDT 2017
## WRONG ! vv
 matica!19 ~$ date -d 'TZ="Europe/Prague" 2017-10-31 15:45' +'%H%M %m/%d/%Y'
1545 10/31/2017
## WRONG ! ^^
 matica!20 ~$ date --version
date (GNU coreutils) 8.26
Packaged by Gentoo (8.26 (p1.1))
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David MacKenzie.


Reproducible: Always
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2017-10-31 07:41:50 UTC
None of the _p1.1 patches appear to touch anything date related, so the problem is not there.
Comment 2 Ian Zimmerman 2017-10-31 21:55:45 UTC
Looking for a workaround, I see that this functions correctly:

 matica!21 coreutils-8.26$ date -d '2017-10-31 15:45 +0300' +'%H%M %m/%d/%Y'
0545 10/31/2017
Comment 3 Ian Zimmerman 2017-10-31 22:17:52 UTC
This also works:

 matica!23 coreutils-8.26$ env TZ=Europe/Prague date -d '2017-10-31 15:45' +'%s'
1509461100

 matica!27 coreutils-8.26$  date -d '@1509461100' +'%H%M %m/%d/%Y'
0745 10/31/2017
Comment 4 Thomas Deutschmann (RETIRED) gentoo-dev 2017-11-06 11:29:25 UTC
Can you reproduce with sys-apps/coreutils[vanilla]?

And please make sure that you are using the same sys-libs/timezone-data version like you are using on your Debian system.
Comment 5 Thomas Deutschmann (RETIRED) gentoo-dev 2017-11-06 14:04:33 UTC
This is https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=851934

Upstream patch: http://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=b14be5085cd1aefd473a000456b21270e6070711

Fixed in >=sys-apps/coreutils-8.27.