From: Oliver Schmidt
Date: Mon, 9 Dec 2013 18:53:27 +0000 (+0100)
Subject: Have %I yield values [1..12] instead of [0..11].
X-Git-Tag: V2.15~207
X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e0262750ced680c4aee163878690a53aceb33fb4;p=cc65
Have %I yield values [1..12] instead of [0..11].
---
diff --git a/libsrc/common/strftime.c b/libsrc/common/strftime.c
index 49d2677cf..25cfd0606 100644
--- a/libsrc/common/strftime.c
+++ b/libsrc/common/strftime.c
@@ -114,7 +114,7 @@ size_t __fastcall__ strftime (char* buf, size_t bufsize, const char* format,
break;
case 'I':
- sprintf (arg, "%02d", tm->tm_hour % 12);
+ sprintf (arg, "%02d", (tm->tm_hour + 11) % 12 + 1);
break;
case 'M':