develooper Front page | perl.datetime | Postings from July 2023

DateTime::Format::MySQL format_time incorrect

Thread Next
From:
"Marcel Versteeg" via datetime
Date:
July 5, 2023 20:03
Subject:
DateTime::Format::MySQL format_time incorrect
Message ID:
5200c1e1d44146e88be09344b5565413@bzn-online.com
The DateTime::Format::MySQL formats microseconds incorrectly in the method 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, where format time returns 06:00:00.1, but instead it should return 06:00:00.000001

Sincerely,
Marcel Versteeg



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About