bug-coreutils
[Top][All Lists]
Advanced

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

Re: date and printf commands


From: Eric Blake
Subject: Re: date and printf commands
Date: Thu, 07 Jan 2010 06:51:40 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666

According to David Venus on 12/23/2009 3:35 PM:
> Hi!
> 
> I have some enhancement suggestions for the date and printf commands.
> 
> DATE:
> 
> 1) Be able to supply the date string as 20091222 instead of 2009-12-22.

That already works:

$ date -d 20091222
Tue Dec 22 00:00:00 MST 2009


> Even better would be the ability to input formats and output formats. This
> would get around this issue in both directions.

Yes, supplying an argument that serves as a format string to strptime,
bypassing the current (fixed-format) date parsing engine, would be a nice
addition to allow date to parse localized formats.  Would you care to
write a patch?  Otherwise, it will probably be a long time before anyone
else has enough of an itch to spend the time implementing it.

> 2) Be able to say things like "fist day of year" (20090101), "week"
> (20091220), "month" (20091201), etc.
> 
> 3) Be able to say things like "last day of year" (20091231), "week"
> (20091226), "month" (20091231), etc.

Improvements to getdate.y are welcome, if you'd like to try your hand at them.

> 
> 4) Separate the date string from the operation, even if it means more flags
> / options.

I'm not sure what you meant.  An example goes a long way at describing
what you envision.

> 1) I would love a way to force grouping and decimal place regardless of the
> locale (LC_*, LANG) settings. Could be an environment variable or command
> line flag, etc.

Umm - LC_ALL _is_ an environment variable, designed for just this purpose.
 In other words, the presence or absence of thousands separators, and the
spelling of the decimal point, are inherently part of the locale, and if
you want a particular formatting, then make sure you are using a locale
that supplies that formatting.

-- 
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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