Present time and date with six digits and do other conversions
-
tinytime epoch
once printed4s5DW1
, that is an epoch timestamp in tinytime base 60 format. -
tinytime 4s5DW1
prints2018-04-24 16:32:01
, if local time zone is +0300 to UTC. -
tinytime 4s5DXW-4s1BXr
prints time difference:4d1h59m39s
4s5DW1
^^^^^^
|||||\.. seconds, symbols 0..9A..Za..x, x equals 59.
||||\... minutes, symbols 0..9A..Za..x
|||\.... hours, symbols 0..9A..N, N equals 23.
\\\..... days since 1970-01-01, symbols 0..9A..Za..x
-
Log timestamps
-
Version numbers
-
In your prompt:
export PS1="\$(tinytime epoch) $PS1"
At the end of .bashrc
:
function tinytime_command_timer() {
TINYTIME_LAST_CMD=$TINYTIME_RUN_CMD
TINYTIME_RUN_CMD=$(HISTTIMEFORMAT= history 1);
if [ "$TINYTIME_LAST_CMD" != "$TINYTIME_RUN_CMD" ]; then
TINYTIME_RUN_START=$(tinytime epoch);
fi
}
PS1='$(tinytime $(tinytime epoch)-$TINYTIME_RUN_START) $(tinytime epoch) '$PS1
TINYTIME_RUN_START=$(tinytime epoch)
trap tinytime_command_timer DEBUG
Screenshot looks:
0s 4vVArG ask@myhost:~$ sleep 2
2s 4vVAs4 ask@myhost:~$