date '+scale=2;((%H*60+%M)*60+%S.%N)/8640' | bc

#Linux #DecimalTime

RE: https://velocipederider.com/@ruari/116353002501207638

In case anyone wanted to know how I set my watch. 😉

Or I can use my other watch to set this one. 🤷

#DecimalTime #DecimalWatch

@ruari nice ... I totally missed the hashtag there and had parsed that one out manually ... do like me a printf/strftime hack ... :)

RE: https://velocipederider.com/@ruari/115475170910895200

@mherbert It was the shortest oneliner I have come up with so far to present the time in decimal for when I have to set my watch.

Though if I am truely honest I would usually just load

https://decimalnow.com/home

Or these days I also have a Garmin that can display in decimal time and that updates automatically, so I can just read it off that.

@ruari ... it was fun to unpack, well done ... given you're smashing that to two significant places I'd probably have dropped anything smaller than a minute, but I totally understand why you didn't ... :)
@ruari initially my heart sank because I'm UTC+10 and the bare 9.21 coming out of that didn't make any sense until I took a closer look ...

@mherbert Speaking of UTC offsets and decimal time. I also have @dailyprogress, though has no offset runs in reverse (count down).

I use it more for a way to understand how far I have done back through my feed. I did not have to do that decimally but percentages are fun and they are decimal, so 🤷

@mherbert Yeah thinking out the logic is

1. Fun
2. Helps me to really understand what I want to achieve and helps to visualise what I am working with.

@ruari well ... I thought it would not make any difference, but it does:

$ date -Iseconds
2026-04-08T22:19:15+10:00
$ date '+scale=2;((%H*60+%M)*60+%S.%N)/8640' | bc
9.30
$ date '+scale=2;((%H*60+%M)*60)/8640' | bc
9.29

@mherbert Yes I played with this a little and had noticed already when comparing with other sources. It makes sense when you realise that a decimal minute is more than a regular minute and a decimal second is less than a second … and there will be rounding.

@mherbert Very often it will be fine but sometimes it will be off if you do not break down with more precision.

Of course you could argue, what is a decimal minute here or there but then, if you are gonna do this… might as well do it right, right!? 😆

@ruari indubitably

@mherbert And of course I like the idea of being self sufficient.

If decimalnow.com dissappears one day or I break/lose/sell Garmin I will want to be able to be know what the right time is.

@ruari ooh ... that's a touch point to someone mere days after a DST change ... the "right time" ... hmmmm

@mherbert 🤣

P.S. I could also make this really easy and just wait for an obvious exact time like midnight and midday. Then set the time to 00/10 or 5 respectively on the watch. 🤷

@ruari I think for extra difficulty, try using decimal sidereal days ... ;)
@ruari ... the more I look into horology, the more it turns into a search to determine the amount of error you're willing to put up with ...
@ruari
date "+2k%H 60*%M+60*%S.%N+8640/p" | dc