diff options
Diffstat (limited to 'lib/App/BorgRestore/Helper.pm')
-rw-r--r-- | lib/App/BorgRestore/Helper.pm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/App/BorgRestore/Helper.pm b/lib/App/BorgRestore/Helper.pm index 8403ec3..8bc4ceb 100644 --- a/lib/App/BorgRestore/Helper.pm +++ b/lib/App/BorgRestore/Helper.pm @@ -3,6 +3,7 @@ use v5.10; use strict; use warnings; +use POSIX (); sub untaint { my $data = shift; @@ -17,6 +18,12 @@ sub untaint_archive_name { return untaint($archive, qr([a-zA-Z0-9-:+\.]+)); } +sub format_timestamp { + my $timestamp = shift; + + return POSIX::strftime "%a. %F %H:%M:%S %z", localtime $timestamp; +} + 1; __END__ |