From d34da1d107199d710b78cf534e8482b87b06ec3f Mon Sep 17 00:00:00 2001 From: FlyingLu <77955264+FlyingLu@users.noreply.github.com> Date: Mon, 1 Nov 2021 16:24:15 +0800 Subject: [PATCH] fixed incorrect 'G' in the format parameter string In the format parameter string, 'G' should have represented 24-hour format of an hour WITHOUT leading zeros. But it actually results in 24-hour format of an hour WITH leading zeros. --- src/ec_date.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ec_date.erl b/src/ec_date.erl index 97bcea3..7ba7e05 100644 --- a/src/ec_date.erl +++ b/src/ec_date.erl @@ -522,7 +522,7 @@ format([$g|T], {_,{H,_,_}}=Dt, Acc) when H > 12 -> format([$g|T], {_,{H,_,_}}=Dt, Acc) -> format(T, Dt, [itol(H)|Acc]); format([$G|T], {_,{H,_,_}}=Dt, Acc) -> - format(T, Dt, [pad2(H)|Acc]); + format(T, Dt, [itol(H)|Acc]); format([$h|T], {_,{H,_,_}}=Dt, Acc) when H > 12 -> format(T, Dt, [pad2(H-12)|Acc]); format([$h|T], {_,{H,_,_}}=Dt, Acc) ->