-
Notifications
You must be signed in to change notification settings - Fork 858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does time need to be < 24h? (use case: elapsed time) #952
Comments
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: #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).
The text was updated successfully, but these errors were encountered: