Built-in library for date & time
Closed this issue · 2 comments
The os.date
/ os.time
functions included with Luau are very minimal, and properly dealing with ISO standards and timezones is notoriously difficult. The built-in functions also contain unexpected behavior that does not conform to ISO standards, one example of this being that the first day of the week is Sunday instead of Monday.
We could use the chrono
crate and reference some prior work and make something like a DateTime
library for Lune:
https://github.com/chronotope/chrono
https://tc39.es/proposal-temporal/docs/index.html
https://create.roblox.com/docs/reference/engine/datatypes/DateTime
This would also let us return much more ergonomic values for date/time in future additions such as #51 .
This is blocking the completion of jest-lua for Lune. The library makes heavy use of Roblox's DateTime
, so we need an equivalent in Lune. I may be able to PR an implementation this weekend.