Bug 822521

Summary: date -d doesnt like hkt timezone
Product: [Fedora] Fedora Reporter: Mohammed Arafa <bugzilla>
Component: coreutilsAssignee: Ondrej Vasik <ovasik>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: kdudka, maxamillion, ovasik, pbrady, p, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
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:
Cloudforms Team: ---

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:

Steps to Reproduce:
1.user the above 3 commands
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