Discussion
Loading...

Discussion

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
alcinnz
alcinnz
@alcinnz@floss.social  ·  activity timestamp 2 months ago

... & a routine for parsing the UTC leapseconds file.

But mostly Hare's `time::chrono` standard library supplies that `timescale` type holding a name, abbrevation, & conversion callbacks.

It has a routine for iterating over the given timescales & converting converting an argument to it, trying multiple conversion callbacks.

There's timescales defined for TAI (no leapseconds), UTC (has leapseconds, GPS (different epoch than UNIX), Teresstrial Time (different epoch), ...

3/4!!

  • Copy link
  • Flag this post
  • Block
Federation Bot
Federation Bot
@Federation_Bot replied  ·  activity timestamp 2 months ago

... & Coordinated Mars Time (rescaled with offsets).

To handle Leap Seconds it reads in the file if needed, compares against the 1st leap-second, iterates backwards over the leapseconds array looking for the relevant entry, & adds/subtracts it. And there's a very similar inverse routine.

3.5/3.5 Fin for today! Tomorrow: The `time::date` sublibrary!

  • Copy link
  • Flag this comment
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.1-beta.33 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Members
  • Code of Conduct