Leonidas-from-XIV / slacko

A neat interface for Slack
https://leonidas-from-xiv.github.io/slacko
Other
81 stars 11 forks source link

Use us precision to represent timestamps. #28

Closed paurkedal closed 6 years ago

paurkedal commented 6 years ago

Using %.f means whole seconds only which makes history searches imprecise. This uses 6 digits to match what Slack supports.

Counting digits, it seems a float should suffice to provide the given precision, though I still worry about rounding errors converting between base 2 and base 10. Would it be better to use precise time stamps, e.g. using Ptime.t? I know at least two indicators that Slack deals with microsecond-precise timestamps:

I can send a new PR changing time stamps to Ptime.t if you wish.

Leonidas-from-XIV commented 6 years ago

Thanks! I agree that representing that as a Ptime.t would most likely be better, so if you want to submit a PR I'd be definitely willing to merge it.