Re: DateTime::Format::MySQL format_time incorrect

[email protected] (Dave Rolsky) Wed, 5 Jul 2023 19:28:34 -0500
Newsgroups perl.datetime
Message-ID <CAHKw1MLH-z1ELfxMkxOcNm+M00M1oyAA8wW8p946KXBR3wd_yw@mail.gmail.com>
--0000000000006369a705ffc6990b
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Marcel,

Yes, that sounds like a bug. I've cc'd the current maintainer of that
module, Mike Wisener, but I'd also suggest reporting the bug via rt.cpan.or=
g
at https://rt.cpan.org/Public/Dist/Display.html?Name=3DDateTime-Format-MySQ=
L


Cheers,

Dave Rolsky
http://blog.urth.org
https://github.com/autarch


On Wed, Jul 5, 2023 at 3:03=E2=80=AFPM Marcel Versteeg via datetime <
[email protected]> wrote:

> The DateTime::Format::MySQL formats microseconds incorrectly in the metho=
d
> format_time. 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_time 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, wher=
e
> format time returns 06:00:00.1, but instead it should return 06:00:00.000=
001
>
> Sincerely,
> Marcel Versteeg
>
>
>

--0000000000006369a705ffc6990b
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Marcel,<div><br></div><div>Yes, that sounds like a bug.=
 I&#39;ve cc&#39;d the current maintainer of that module, Mike Wisener, but=
 I&#39;d also suggest reporting the bug via <a href=3D"http://rt.cpan.org">=
rt.cpan.org</a> at=C2=A0<a href=3D"https://rt.cpan.org/Public/Dist/Display.=
html?Name=3DDateTime-Format-MySQL">https://rt.cpan.org/Public/Dist/Display.=
html?Name=3DDateTime-Format-MySQL</a></div><div><br clear=3D"all"><div><div=
 dir=3D"ltr" class=3D"gmail_signature" data-smartmail=3D"gmail_signature"><=
div dir=3D"ltr"><div><div dir=3D"ltr"><div><br></div><div>Cheers,</div><div=
><br></div><div>Dave Rolsky</div><div><a href=3D"http://blog.urth.org" targ=
et=3D"_blank">http://blog.urth.org</a></div><div><a href=3D"https://github.=
com/autarch" target=3D"_blank">https://github.com/autarch</a></div></div></=
div></div></div></div><br></div></div><br><div class=3D"gmail_quote"><div d=
ir=3D"ltr" class=3D"gmail_attr">On Wed, Jul 5, 2023 at 3:03=E2=80=AFPM Marc=
el Versteeg via datetime &lt;<a href=3D"mailto:[email protected]">datetime@=
perl.org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D=
"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-le=
ft:1ex"><div style=3D"font-family:arial;font-size:14px"><div style=3D"box-s=
izing:border-box">The DateTime::Format::MySQL formats microseconds incorrec=
tly in the method format_time. It simply concatenates the number of microse=
conds after the formatted hms, however this is incorrect when the number of=
 microseconds is less than 100,000.</div><div style=3D"box-sizing:border-bo=
x"><br style=3D"box-sizing:border-box"></div><div style=3D"box-sizing:borde=
r-box">If a date object returns 12,345 microseconds at 5 am, the function f=
ormat_time returns 05:00:00.12345, but it should return 05:00:00.012345 (mi=
nd the &#39;0&#39; between the period and the 1).</div><div style=3D"box-si=
zing:border-box"><br style=3D"box-sizing:border-box"></div><div style=3D"bo=
x-sizing:border-box">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.000001</div><div style=3D"box-sizing:border-box"><br style=
=3D"box-sizing:border-box"></div><div style=3D"box-sizing:border-box">Since=
rely,</div><div style=3D"box-sizing:border-box">Marcel Versteeg</div><div s=
tyle=3D"box-sizing:border-box"><br style=3D"box-sizing:border-box"></div><d=
iv style=3D"box-sizing:border-box"><span style=3D"box-sizing:border-box">=
=C2=A0</span></div></div>
</blockquote></div>

--0000000000006369a705ffc6990b--