From b717517d3cd90745a74425c4281a1b8e69a62b93 Mon Sep 17 00:00:00 2001 From: kre Date: Wed, 22 Mar 2017 00:59:06 +0000 Subject: [PATCH] Fix PR lib/52101 -- 12:30 am is 00:30:00 and 12:30 pm is 12:30:00 --- lib/libutil/parsedate.y | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/libutil/parsedate.y b/lib/libutil/parsedate.y index 48fd033e76bd..02f2868b144c 100644 --- a/lib/libutil/parsedate.y +++ b/lib/libutil/parsedate.y @@ -14,7 +14,7 @@ #include #ifdef __RCSID -__RCSID("$NetBSD: parsedate.y,v 1.29 2016/06/26 07:09:24 kre Exp $"); +__RCSID("$NetBSD: parsedate.y,v 1.30 2017/03/22 00:59:06 kre Exp $"); #endif #include @@ -654,7 +654,9 @@ Convert( tm.tm_sec = Seconds; tm.tm_min = Minutes; - tm.tm_hour = Hours + (Meridian == MERpm ? 12 : 0); + tm.tm_hour = ((Hours == 12 && Meridian != MER24) ? 0 : Hours) + + (Meridian == MERpm ? 12 : 0); + tm.tm_mday = Day; tm.tm_mon = Month - 1; tm.tm_year = Year - 1900;