Bug 822521 - date -d doesnt like hkt timezone
Summary: date -d doesnt like hkt timezone
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: coreutils
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ondrej Vasik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-17 14:50 UTC by Mohammed Arafa
Modified: 2012-05-18 07:57 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-05-18 07:57:01 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Mohammed Arafa 2012-05-17 14:50:49 UTC
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 15:10:00 UTC
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-18 00:09:11 UTC
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 07:57:01 UTC
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.