[Top][All Lists]

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

Re: date(1): -d argument parsing error

From: James Youngman
Subject: Re: date(1): -d argument parsing error
Date: Wed, 10 Dec 2008 00:07:09 +0000

On Tue, Dec 9, 2008 at 5:19 PM, Jan Minář <address@hidden> wrote:
> Hi.
> date(1) command parses "next $day_of_week_today" (where
> $day_of_week_today is today's day name) incorrectly:
> $ date
> Tue Dec  9 17:16:50 GMT 2008
> $ date -d "next `date +%A`"
> Tue Dec  9 00:00:00 GMT 2008
> It should print the next Tuesday's date, i.e. today + 7 days.

The date parser does not support as input weekday names in arbitrary
languages; see the documentation for the date command.

Fortunately, the problem is simple to work around, by overriding the
locale selection for the inner date command:-

$ date -d "next `LC_ALL=C date +%A`"
mercredi 10 décembre 2008, 00:00:00 (UTC+0000)


reply via email to

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