From 490e8c3bbe4b2fa343c1b4216176d772f0889d99 Mon Sep 17 00:00:00 2001 From: Kuzma Shapran Date: Tue, 14 Mar 2023 08:43:22 +1300 Subject: [PATCH] Fix locale-aware representation of hours in Date class --- quickjs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickjs.c b/quickjs.c index 791601391..b8eef5475 100644 --- a/quickjs.c +++ b/quickjs.c @@ -48203,7 +48203,7 @@ static JSValue get_date_string(JSContext *ctx, JSValueConst this_val, break; case 3: pos += snprintf(buf + pos, sizeof(buf) - pos, - "%02d:%02d:%02d %cM", (h + 1) % 12 - 1, m, s, + "%02d:%02d:%02d %cM", (h + 11) % 12 + 1, m, s, (h < 12) ? 'A' : 'P'); break; }