NAME
Time::Decimal -- Handle french revolutionary ten hour days
SYNOPSIS
use Time::Decimal qw($precision h24s_h10 h24_h10 h10s_h24 h10_h24
transform now_h10 loop);
$precision = 'ms';
$dec = h24s_h10( 1234.5678 );
$dec = h24_h10( 13, 23, 45, 345_678 );
$bab = h10s_h24( 1234.5678 );
$bab = h10_h24( 1, 50, 75, 345_678 );
$dec = transform( '13:23' );
$dec = transform( '1:23:45.345_678 pm' );
$bab = transform( '1_50_75.345_678' );
$dec = now_h10;
$dec = now_h10( time + 60 );
$precision = 's';
loop { print "$_[0]\t" . localtime() . "\n" };
or
perl <path>/Time/Decimal.pm [-option ...] [time ...]
ln <path>/Time/Decimal.pm dectime
dectime [-option ...] [time ...]
DESCRIPTION
The Babyloninan 24 hour clock is one of the last complicated vestiges of the pre-decimal age. The french revolution, when it created decimal measures for everything, also invented a division of the day into ten hours of 100 minutes and again 100 seconds each. The advantage is that seconds and minutes are roughly as long as those we know. Hours are of course more than twice as long.
La babilona 24-hora horloĝo estas unu de la lastaj komplikaj restaĵoj de la antaŭ-dekuma epoko. La franca revolucio, kiam ĝi kreis dekumajn mezurojn por ĉio, ankaŭ inventis disdividon de la tago en dek horojn, ĉiuj je 100 minutoj kaj tiuj de 100 sekundoj. La avantaĝo estas ke sekundoj kaj minutoj daŭras proksimume same kiel tiuj kiujn ni konas. Horoj kompreneble daŭras pli ol duoble.
Por povi memstare rekoni dekuman tempon, ni uzas _
anstataŭ :
kiel separilo. Tiu signo uzeblas en multe pli da komputilaj kuntekstoj. En Perl ĝi estas ebla separilo inter ciferoj. Kaj pri tio ja temas ĉi tie, ĉar dekuma tempo H_MM estas nenio alia ol tri-cifera nombro da minutoj. Samo direblas pri kvin-cifera nombro da sekundoj
So as to be able to automatically recognize decimal time, we use _
instead of :
as a separator. This character is usable in many more computer contexts. In Perl it is a possible separator between digits. And that's what it means here, because a decimal time H_MM is nothing else than a three digit number of minutes. The same applies to five digit numbers of seconds.
Module Interface
Nothing is exported by default, but all of the following may be imported by the use
statement:
Nenio estas memstare elportita, sed vi povas enporti la sekvajn per la use
ordono:
- $precision
-
's' seconds 'ds' deciseconds 'cs' centiseconds 'ms' milliseconds 'µs', 'us' microseconds
UTF-8, Latin-1, -3, -5, -7 or Latin-9
Command Line Interface
- -s, --seconds
- -d, --ds, --deciseconds
- -c, --cs, --centiseconds
- -m, --ms, --milliseconds
- -u, --us, --microseconds
-
Output times at the given precision, instead of minutes.
Eligu tempojn je la donita precizeco, anstataŭ minutoj.
- -e, --echo
-
Output the transformed time along with the transformation.
Eligu la transformitan tempon kune kun la transformaĵo.
- -r, --reverse
-
Retransform the transformation to see possible loss due to insufficient precision.
Retransformu la transformaĵon por vidi eblan perdon pro manko de precizeco.
- -l, --loop
-
Output the time again each time the result changes at the wanted precision. Can be used as a clock, but if the precision is too small, the terminal emulation may have problems, either flickering or stalling.
Eligu la tempon denove ĉiufoje ke la rezulto ŝanĝiĝas je la dezirita precizeco. Uzeblas kiel horloĝo, sed se la precizeco tro malgrandas, la montrila programo povas havi problemojn, aŭ ŝanceliĝante, aŭ rifuzante.
- -o, --old, --old-table, --babylonian, --babylonian-table
- -n, --new, --new-table, --decimal, --decimal-table
-
Supplies about 70 times of common interest. Implies
--echo
.Provizas ĉirkaŭ 70 tempoj de komuna intereso. Implicas
--echo
.
SEE ALSO
DateTime::Calendar::FrenchRevolutionary fits nicely into the DateTime hierarchy. Alas that doesn't handle fractions, so they have a lossy transformation. Besides fractions are much more natural in decimal time.
AUTHOR
Daniel Pfeiffer <occitan@esperanto.org>