Context
- Operating System & Odin Version: Linux 6.7.6, Odin commit 7df7fec
Expected Behavior
The following program should output a date of March 1st, but it reports February the 29th.
package main
import "core:fmt"
import "core:time"
main :: proc() {
fmt.println(time.datetime_to_time(2024, 3, 1, 0, 0, 0))
}
Failure Information (for bugs)
The program prints this:
2024-02-29 00:00:00.000000000 +0000 UTC true
I think the procedure isn't taking into account leap years with regard to February's extra day, and the logic behind DAYS_PER_400_YEARS and the other calculations is sound, but it's starting the arithmetic modulo from the year minus 1970, which would give incorrect results.
Context
Expected Behavior
The following program should output a date of March 1st, but it reports February the 29th.
Failure Information (for bugs)
The program prints this:
I think the procedure isn't taking into account leap years with regard to February's extra day, and the logic behind
DAYS_PER_400_YEARSand the other calculations is sound, but it's starting the arithmetic modulo from the year minus 1970, which would give incorrect results.