From feebd2a7337b63e1530c30ecdac54800e9550947 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Fri, 1 Mar 2024 12:09:47 +0100 Subject: [PATCH] Bug in `time.add_seconds` #1162. --- lib/std/time/time.c3 | 2 +- releasenotes.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/std/time/time.c3 b/lib/std/time/time.c3 index c58273ad6..26bac8bbf 100644 --- a/lib/std/time/time.c3 +++ b/lib/std/time/time.c3 @@ -78,7 +78,7 @@ fn Time now() $endif } -fn Time Time.add_seconds(time, long seconds) => time + (Time)(seconds * (long)MS); +fn Time Time.add_seconds(time, long seconds) => time + (Time)(seconds * (long)SEC); fn Time Time.add_minutes(time, long minutes) => time + (Time)(minutes * (long)MIN); fn Time Time.add_hours(time, long hours) => time + (Time)(hours * (long)HOUR); fn Time Time.add_days(time, long days) => time + (Time)(days * (long)DAY); diff --git a/releasenotes.md b/releasenotes.md index f218cfa4b..31fb362de 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -14,6 +14,7 @@ - `.$Type = ...` and `.$foo = ...` now works #1156. - `int.min` incorrect behaviour #1154. - Bitstruct cast to other bitstruct by way of underlying type would fail #1159. +- Bug in `time.add_seconds` #1162. ### Stdlib changes - Added `new_aligned` and `alloc_aligned` functions to prevent accidental under-alignment when allocating simd.