bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #16214] 'date -d' missets the hour using certain syntax


From: Dallman Ross
Subject: [bug #16214] 'date -d' missets the hour using certain syntax
Date: Wed, 29 Mar 2006 14:13:56 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1

URL:
  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=16214>

                 Summary: 'date -d' missets the hour using certain syntax
                 Project: GNU Core Utilities
            Submitted by: dman
            Submitted on: Wed 03/29/06 at 14:13
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open

    _______________________________________________________

Details:

Two examples of valid syntax for date follows:

   date -d "12:00 1 year ago"
   date -d "12:00 a year ago"

The 'date' command acts as if it understands the indefinite article 'a' in
this case.  However, the time returned is off by one hour.

Sample output:

bash-3.00$ date --version | head -1
date (GNU sh-utils) 2.0

bash-3.00$ TZ=UTC  

   

bash-3.00$ date -d "12:00 1 year ago" 
Tue Mar 29 12:00:00 UTC 2005

bash-3.00$ date -d "12:00 a year ago" 
Tue Mar 29 13:00:00 UTC 2005

bash-3.00$ date -d "12:00 a month ago"     
Wed Mar  1 13:00:00 UTC 2006

bash-3.00$ date -d "12:00 next month"
Sat Apr 29 12:00:00 UTC 2006

bash-3.00$ date -d "12:00 a month ago next month"  # today
Wed Mar 29 13:00:00 UTC 2006

-- 
Dallman Ross



    _______________________________________________________

Carbon-Copy List:

CC Address                          | Comment
------------------------------------+-----------------------------
address@hidden           | 




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=16214>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]