Closed silverhook closed 1 year ago
Yes, the Time type in TOML is a time point, as in, a specific time of day (optionally at a specific date using the full Date-Time formats).
What you're asking for is a Duration type; there's a proposal to add one to the language here: https://github.com/toml-lang/toml/issues/514
Ah, thanks. I searched before and at a very lazy look that issue did not seem the same, but you’re right.
I’m closing this issue in favour of #514 then.
If you're not too interested in down-to-the-nanosecond precision, a user-friendly workaround for this is to simply use a float, e.g.
timeout_minutes = 2.5 # 2 min 30 sec
@marzer That’s a good option, thanks. But my use case is at the same time kinda niche and silly, and not really that important – I use TOML to keep my highscores and a few games record also how much time something took.
I decided to just save it as a string for now.
Ah yup, in that case you'd definitely want precision, lest you incur the wrath of angry players :D
I have a use-case where I want to log how much time something took.
In that case should I use the (local?) time type? Which may be against the (local) time type intention.
or do I need to declare it as a string? Which is just very confusing since there is also a time type (and it is OK if you use it within the range of 24h).