coreutils
[Top][All Lists]
Advanced

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

Re: date command is great but could use improvements


From: David Chmelik
Subject: Re: date command is great but could use improvements
Date: Sun, 3 Jul 2022 04:09:33 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1

Year, season, month, fortnight, week (in the year) & their day numbers should all be possible to get/print starting from '1' (regardless of calendar/country) in date command format itself (so usable in X Window System clocks, etc.)  I'll reply to a couple replies.

On 5/24/22 1:30 PM, Bob Proulx wrote:
The goal of the Unix Philosophy is not to program every possibility but to make 
programming every possibility possible.  There is already a rich set of 
features that has proven powerful over the last five decades.  If one needs 
special cases that are not part of the fundamental set then it is possible and 
fairly easy to create such a custom function.  The command line shell is well 
suited to this type of customization.
Using such possibilities for creation/customization is easy for programmers, but not average users depending on date command format (for GUI clocks,) and UNIX influenced most popular OS (Replicant/Android Linux, which has some GNU available) mostly used by average users as are others (GNU/Linux, for which I help several users.)

Note that GNU date does support the concept of "fortnight" being 14 days.  See 
the documentation for details.
'info date' mentions 'fortnight' usage (unclear.)

By Act of Congress the US timezones have been established.  The names used are 
not always unambiguous.  Their use is not recommended.
.
Then manpage should either correctly distinguish between time zones & settings or replace those mentions.  I don't know who recommends against time zones but not average people.  No one I know uses UTC except friends/family living there, whom say GMT.

I see that Webster does specify this alternate usage.  :-)
Manpages should be understandable in international English--mostly like British English (main/original dialect anyway)--in which 'alternate' isn't synonym for 'alternative,' and older Americans I know (probably smarter than some dictionary editors) don't agree with such highly-confusing, absolutely incorrect, bad/slang grammar; even some USA university English professors I know primarily use the Oxford English Dictionary (OED.)

It is not recommended to set the system clock to local time.  Better to always 
set the system clock to UTC.
I don't know who recommends against local time, but not average people: local time is easiest for PCs, and servers system administrator (sysadmin) wants local time.  Specific software might benefit from UTC on some servers, but on only one of 18 I have a reason for UTC but for other reasons on that server it's a hindrance (so don't use it in software servers/daemons on other shells either.)  Do you really think most Replicant/Android, other users set UTC?  I never did on MS-DOS & Windows 3 to 95/98, nor some years after dual-booting those with *BSD UNIX & GNU/Linux, though in recent years we needed 64-bit Windows to be able to fill out organzation/government forms requiring Adobe Acrobat, and do MS Office things non-replicated/broken in Libre Office, etc... apparently Windows started using UTC, but I don't know about other popular PC OSs... some Replicant/Android variants use local time zone & setting (might vary.)  In fact in recent years I've had /zero trouble/ using local time zone & setting on UNIX/GNU/Linux; only newer Windows expected UTC!  Some years ago some X/KDE assumed UTC without checking /etc/localtime, then fixed.  Unless one is in a location or project/organization that uses UTC, it's useless or hindrance.

On 5/26/22 12:16 PM, Carl Edquist wrote:
In the states i am used to Sunday being the first "day of the week", but "weekdays" refer specifically to Monday-Friday, thus even in the states, Monday is the first "weekday" :)
'Weekday' abbreviates 'day of week' (including /workdays///schooldays/, weekends) as in date command manpage ('%A locale's full weekday name (e.g., Sunday: )')

I think the confusion comes from conflating ordinal and cardinal numbers.
No confusion; not at all.  How mathematicians/programmers think about numbers/variables and most think about time/date differ.

Ordinal numbers (first, second, third) describe the order in the sequence, and cardinal numbers (zero, one, two, three) count how many.
There's no consensus among computer scientists (CS) & mathematicians/CS, and mathematicians; many say natural (N) & etc. (counting, whole, whatever one calls various) numbers start from one, but mathematicians/CS often say from zero: different definitions, but I almost never focus on 'cardinals versus ordinals:' terms not mentioned in my original post (OP.)

If you take a close look at the definitions of the members of the tm structure (as provided in Bob's email), you will see "number of seconds", "number of minutes", "number of hours", "number of days", "number of months" -- these are all cardinal numbers (they count how many) and thus start with zero.
I know, but average users normally use those (despite hours or minutes and smaller starting at zero) to indicate specific time/date (ordinal, what the date command without arguments/flags/switches prints) often still in relation to measuring time amounts that passed or should for some action (cardinal, but can start or end at an ordinal, what the time command and organizer/scheduling software is for, which hadn't even been mentioned.)  Most the world, including most the English-speaking world, uses 24-hour civilian time but even when says "current time is 0:00" that's ordinal! Year, season, month, fortnight, week (in the year) & their day numbers should all be possible to get/print starting from '1' (regardless of calendar/country) in date command format because worldwide average users think that way--sometimes even programmers--elaborated previously.

We're familiar with the "day of the month" being ordinal, but in plain English, the "day of the week" is usually given with the day's _name_ rather than its ordering.  (On the other hand, in Greek, the name for Monday means "Second", and the name for "Tuesday" means "Third", etc.)
Plain English includes (initially, anytime) discussing numbers in calendars, and weekday number is also good to save space and besides weekday name in case forget number (can happen when very tired) so that's why I used it in GUI clock (then removed because couldn't start local calendar weekday '1.')  Day names in Greece are all the more reason (science originating there.)

The made-up word "zeroth" is a fiction, i suppose, imagined by people who blur the distinction between ordinal and cardinal numbers. When something is _first_, nothing comes before it! :)
En.wikipedia.org/wiki/Zeroth cites 'zeroth' in mathematics/CS since 1960s (I heard term in those high school and/or college/university subjects) and though I couldn't check recent OED updates, Oxford's newer (not de facto, but documents newer British usage) English dictionary mentions 'zeroth' since 1800s.

(And, no, 1900 was not the zeroth year of the 20th century.  It was the 100th year of the 19th century!)
Most people say first of 20th century; I don't think anyone says 'one to 10 are ones; 11 is first of the tens,' rather than zero or one to nine are ones, and 10 to 19 are tens, etc...




reply via email to

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