diff --git a/lib/LDV/Helpers.pm b/lib/LDV/Helpers.pm index 3caa677..acf224b 100644 --- a/lib/LDV/Helpers.pm +++ b/lib/LDV/Helpers.pm @@ -6,6 +6,7 @@ use utf8; use Mojo::Base 'Mojolicious::Plugin'; +use POSIX qw(strftime); use Text::Markdown; sub register { @@ -22,6 +23,11 @@ sub register { $text =~ s{\r?\n}{
}go; return $text; }); + + $app->helper(from_unixtime => sub { + my ($c, $unixtime) = @_; + return strftime("%Y-%m-%d %H:%M", localtime($unixtime)); + }); } 1;