Created
January 24, 2018 22:40
-
-
Save exodist/78eccc407df1ff62ca044169878d9508 to your computer and use it in GitHub Desktop.
fix a stamp for postgres
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub format_stamp { | |
my $stamp = shift; | |
return undef unless $stamp; | |
my $out = DateTime->from_epoch(epoch => $stamp)->stringify; | |
$out .= $1 if sprintf("%.10f", $stamp) =~ m/(\.\d+)$/; | |
return $out; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment