]> git.kaiwu.me - quickjs.git/commitdiff
fixed Date.toLocaleString() (kuzmas)
authorFabrice Bellard <fabrice@bellard.org>
Mon, 8 Jan 2024 18:02:30 +0000 (19:02 +0100)
committerFabrice Bellard <fabrice@bellard.org>
Mon, 8 Jan 2024 18:02:30 +0000 (19:02 +0100)
quickjs.c

index a09781b1a96bd9307dc71eb64901a71e1def7402..a6cab1d9339fa10da66137395ea0871e2b707d79 100644 (file)
--- a/quickjs.c
+++ b/quickjs.c
@@ -49472,7 +49472,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;
         }