(Video materials in preparation)
time-excel : Convert a Date and/or time to Excel date/time format
Usage : time-excel [-r] <f1> <f2> .. <file>
Options : --force
--through=<string>
Version : Tue Jan 9 09:02:34 JST 2024
Edition : 1
Converts a date and/or time (YYYYMMDD, YYYYMMDDHHMMSS, HHMMSS) to
Excel date/time format "Integer.Fraction".
The fields must be specified in ascending order. You can also
specify consecutive fields such as "1/3". You can use NF to specfy
the last field.
If the file name is omitted or if it is specified as "-" then the
command will read from standard input.
Use the -r option to convert in the reverse direction.
If the --force option is specfied with the -r option then the
converted field is always YYYYMMDDHHMMSS format even if the input
field is an integer.
If the --through option is specfied then the field which content is
<string> is output unchanged.
$ echo 20121010 121212 20121010121212 | time-excel 1/3
41192 0.5084722 41192.5084722
$ echo 41192 0.5084722 41192.5084722 | time-excel -r 1/3
20121010 121212 20121010121212
$ echo 41192 0.5084722 41192.5084722 | time-excel -r --force 1/3 -
20121010000000 121212 20121010121212
$ echo 20121010 _ 20121010121212 | time-excel --through=_ 1/3 -
41192 _ 41192.5084722