Bug 822521 - date -d doesnt like hkt timezone
date -d doesnt like hkt timezone
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: coreutils (Show other bugs)
16
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Ondrej Vasik
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-17 10:50 EDT by Mohammed Arafa
Modified: 2012-05-18 03:57 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-05-18 03:57:01 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Mohammed Arafa 2012-05-17 10:50:49 EDT
Description of problem:
date doesnt seem to like the HKT timezone 

the following commands will not work
#echo HKT: `date -d "2012-05-18 21:00:00 HKT"`
#echo `TZ=America/New_York date -d "$(TZ=:Asia/Hong_Kong date -d 9pm)" `

however this command does
#echo "HKG: `TZ=':Asia/Hong_Kong' date`"

Version-Release number of selected component (if applicable):


How reproducible:
everytime

Steps to Reproduce:
1.user the above 3 commands
2.
3.
  
Actual results:
date: invalid date `2012-05-18 21:00:00 HKT'


Expected results:
just works(tm)

Additional info:
Comment 1 Pádraig Brady 2012-05-17 11:10:00 EDT
Parsing these abbreviated timezones is inconsistent and ambiguous.
I wrote some notes on this here: http://www.pixelbeat.org/docs/linux_timezones/
Please only use the location based Asia/Hong_Kong as input
Comment 2 Mohammed Arafa 2012-05-17 20:09:11 EDT
pls. see the second command used. it uses the full location as a timezone and yet the issue is still occurring
Comment 3 Pádraig Brady 2012-05-18 03:57:01 EDT
The second command in comment 1 is really 2 commands,
the first of which will generate an abbreviated output as
input to the second.

You can do what (I think) you want in a single date invocation,
using this form that was shown at link in comment 2:

  TZ="America/New_York" date -d 'TZ="Asia/Hong_Kong" 9pm'

That shows the local time in New York corresponding to 9PM in Hong Kong

Note You need to log in before you can comment on or make changes to this bug.