[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Decimal time support in 'date'
From: |
za3k |
Subject: |
Re: Decimal time support in 'date' |
Date: |
Fri, 13 Dec 2019 14:04:40 -0800 |
User-agent: |
Roundcube Webmail/1.3.9 |
On 2019-12-13 01:03, Assaf Gordon wrote:
Hello,
Thank you for the suggestion and for checking in first - that's an
excellent approach.
Thanks! And thanks for the reply.
I'm just some guy who wants to write my journal / system clock / etc in
this format, I don't use it professionally. That said, I do think it's
important to support the actual use cases, so I did a day or two of
research. I really need to talk to the people that actually use this
stuff to answer many questions :). But I figured there was a good chance
coreutils would say 'naaah, no chance' so though I'd check in first.
This is an interesting idea, certainly worth discussing.
When such format is used by time-keepers or scientific recording, is
it being used
on the command-line or from a shell script? or is this more commonly
done in a higher-level programming language?
Can you expand on the other format used by Astronomers?
I basically don't know as to the state of software, although I have
educated guesses (timekeeping will use high level languages, but perl
CGI scripts will call date--scientific recording will use a mix). The
documentation I've found has been about doing it by hand, but that's not
much of a hint whether it's normally done by hand. I doubt consulting
someone will help answer this, but if can think of anyone, you can put
us in touch or ask.
Based on very cursory research, astronomers have multiple systems in
active use. They all deviate from the "usual" calendar. Astronomers
would need a whole new 'date' specialized for astronomy. I've seeing
some Julian dates as a continuous count of days since 4712BC (Julian
Date) or another epoch (Modified Julian Date), some using a Gregorian
calendar (more uniform leap days) or modified Gregorian calendar. The
decimal time part of what they're doing is otherwise the same. Some
systems (Julian Date) take solar noon as the start of the day rather
than midnight, but I'm not clear whether it's in use.
It's worth mentioning for the curious that a decimal time system is used
by "Internet Time" (some Swiss watchmaker's gimmick? -- again no DST is
observed) and has been used historically. Notably, for 2-3 years after
the French Revolution nation-wide (again no DST is observed), which I
think is why it's relatively standardized; this was how the metric
system was formed but decimal time had poor adoption. Wikipedia claims
decimal time may have been used historically in China but I'm not
personally familiar enough.
Again, NONE of the systems seems to be widely adopted (decimal hour and
day DURATIONS are widely adopted in timekeeping for daily/hourly
workers, but that's different). The reason I'm proposing the decimal
portion of the day to X digits is that it seems to be the part that's
consistent across all of these systems, and it's enough to display times
in the modern ones. The French system needs substring support to display
times like "1:34:56", so if you want to write your dates in 1794 France,
you'll have to do your own string postprocessing.
After talking to an expert, there may be some use for decimal fractions
of an hour in timekeeping, I'll have to check.
If we consider adding a new letter operator (e.g. "%X" ) we should
make sure it does not conflate with any existing letters, including on
non-gnu implementations (e.g. on BSDs).
Good reminder. Other than GNU and BSD ports, any specific
implementations to check?
----
On 2019-12-12 21:53, Kenneth Irving wrote:
I've been using the 'decimal day' informally for my own purposes for
several years, and used to have a widget display it along with
'regular' time on my workstation.
[...snipped...]
I'm not sure how either of these would work out in coreutils date(1),
since it has to take a more formally correct approach, but perhaps
they could be useful.
Ken
Well I'm glad to hear at least one person would use this. In general I
would prefer to add only format types which would be used by several
people and preferably are relatively standardized--I'm happy to play
with time systems on my desktop widgets etc but I need a justification
to add stuff to coreutils :) I haven't seen anyone else use decimal
years, although it does seem like a perfectly sensible system.