From 26374971ab82d20f78527e120b69915c2751e8dd Mon Sep 17 00:00:00 2001 From: Swastik Baranwal Date: Tue, 14 Jan 2020 22:42:28 +0530 Subject: [PATCH] time: fix logic --- vlib/time/time_unix.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/time/time_unix.v b/vlib/time/time_unix.v index e940112ae1..4ae0679322 100644 --- a/vlib/time/time_unix.v +++ b/vlib/time/time_unix.v @@ -84,10 +84,10 @@ fn calculate_date_from_offset(day_offset_ int) (int, int, int) { } mut estimated_month := day_offset / 31 - for day_offset > days_before[estimated_month+1] { + for day_offset >= days_before[estimated_month+1] { estimated_month++ } - for day_offset <= days_before[estimated_month] { + for day_offset < days_before[estimated_month] { if estimated_month == 0 { break }