DateTime::Format::MySQL format_time incorrect

[email protected] ("Marcel Versteeg" via datetime) Wed, 5 Jul 2023 22:03:08 +0200
Newsgroups perl.datetime
Message-ID <[email protected]>
--a2e55154b7654a4ea6b6b69c3c342858
Content-Type: text/plain;
	charset="utf-8"
Content-Transfer-Encoding: quoted-printable

The DateTime::Format::MySQL formats microseconds incorrectly in the method =
format=5Ftime. It simply concatenates the number of microseconds after the =
formatted hms, however this is incorrect when the number of microseconds is=
 less than 100,000.

If a date object returns 12,345 microseconds at 5 am, the function format=
=5Ftime returns 05:00:00.12345, but it should return 05:00:00.012345 (mind =
the '0' between the period and the 1).

Another example would be if the number of microseconds is 1 at 6 am, where =
format time returns 06:00:00.1, but instead it should return 06:00:00.00000=
1

Sincerely,
Marcel Versteeg

 

--a2e55154b7654a4ea6b6b69c3c342858
Content-Type: text/html;
	charset="utf-8"
Content-Transfer-Encoding: quoted-printable

<div style=3D"font-family: arial; font-size: 14px;"><div fr-original-style=
=3D"" style=3D"box-sizing: border-box;">The DateTime::Format::MySQL formats=
 microseconds incorrectly in the method format=5Ftime. It simply concatenat=
es the number of microseconds after the formatted hms, however this is inco=
rrect when the number of microseconds is less than 100,000.</div><div fr-or=
iginal-style=3D"" style=3D"box-sizing: border-box;"><br fr-original-style=
=3D"" style=3D"box-sizing: border-box;"></div><div fr-original-style=3D"" s=
tyle=3D"box-sizing: border-box;">If a date object returns 12,345 microsecon=
ds at 5 am, the function format=5Ftime returns 05:00:00.12345, but it shoul=
d return 05:00:00.012345 (mind the '0' between the period and the 1).</div>=
<div fr-original-style=3D"" style=3D"box-sizing: border-box;"><br fr-origin=
al-style=3D"" style=3D"box-sizing: border-box;"></div><div fr-original-styl=
e=3D"" style=3D"box-sizing: border-box;">Another example would be if the nu=
mber of microseconds is 1 at 6 am, where format time returns 06:00:00.1, bu=
t instead it should return 06:00:00.000001</div><div fr-original-style=3D""=
 style=3D"box-sizing: border-box;"><br fr-original-style=3D"" style=3D"box-=
sizing: border-box;"></div><div fr-original-style=3D"" style=3D"box-sizing:=
 border-box;">Sincerely,</div><div fr-original-style=3D"" style=3D"box-sizi=
ng: border-box;">Marcel Versteeg</div><div fr-original-style=3D"" style=3D"=
box-sizing: border-box;"><br fr-original-style=3D"" style=3D"box-sizing: bo=
rder-box;"></div><div fr-original-style=3D"" style=3D"box-sizing: border-bo=
x;" contenteditable=3D"false"><span fr-original-style=3D"" style=3D"box-siz=
ing: border-box;">&nbsp;</span></div></div>

--a2e55154b7654a4ea6b6b69c3c342858--