Change-Id: Id65aa4e39fc0e40e9b97c45c6aeca70f52acad6achanges/47/15047/6
parent
8c8c3fe9c3
commit
6dbc911d7f
@ -0,0 +1,28 @@
|
|||||||
|
package NGCP::Schema::Storage::DateTime::Format::MySQL;
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
use vars qw ($VERSION);
|
||||||
|
|
||||||
|
$VERSION = '0.06';
|
||||||
|
|
||||||
|
use base ("DateTime::Format::MySQL");
|
||||||
|
|
||||||
|
sub format_time
|
||||||
|
{
|
||||||
|
my ( $self, $dt ) = @_;
|
||||||
|
my ($h,$m,$s) = ($dt->hour(), $dt->minute(), $dt->second());
|
||||||
|
if ($s >= 60) { #Returns the second, from 0..61. The values 60 and 61 are used for leap seconds.
|
||||||
|
$s = 59;
|
||||||
|
}
|
||||||
|
my $sep = ':';
|
||||||
|
return sprintf(
|
||||||
|
'%0.2d%s%0.2d%s%0.2d',
|
||||||
|
$h, $sep,
|
||||||
|
$m, $sep,
|
||||||
|
$s
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
1;
|
Loading…
Reference in new issue