projects
/
kivitendo-erp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f5b999c
)
Refactoring: Verwendung von POSIX::strftime anstelle von localtime() + sprintf
author
Moritz Bunkus
<m.bunkus@linet-services.de>
Wed, 3 Jul 2013 07:44:01 +0000
(09:44 +0200)
committer
Moritz Bunkus
<m.bunkus@linet-services.de>
Wed, 3 Jul 2013 07:44:01 +0000
(09:44 +0200)
SL/Common.pm
patch
|
blob
|
history
diff --git
a/SL/Common.pm
b/SL/Common.pm
index
c0be296
..
84cb9c2
100644
(file)
--- a/
SL/Common.pm
+++ b/
SL/Common.pm
@@
-12,11
+12,13
@@
use utf8;
use strict;
use Carp;
use strict;
use Carp;
+use English qw(-no_match_vars);
use Time::HiRes qw(gettimeofday);
use Data::Dumper;
use File::Copy;
use File::stat;
use File::Slurp;
use Time::HiRes qw(gettimeofday);
use Data::Dumper;
use File::Copy;
use File::stat;
use File::Slurp;
+use POSIX ();
use SL::DBUtils;
use SL::DBUtils;
@@
-652,15
+654,9
@@
sub copy_file_to_webdav_folder {
$::lxdebug->leave_sub();
}
$::lxdebug->leave_sub();
}
-sub get_current_formatted_time {
- $main::lxdebug->enter_sub();
-
- my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
- my $formatted_current_time = sprintf ( "_%04d%02d%02d_%02d%02d%02d",
- $year+1900,$mon+1,$mday,$hour,$min,$sec);
- $main::lxdebug->leave_sub();
- return
$formatted_current_time
;
+sub get_current_formatted_time {
+ return
POSIX::strftime('_%Y%m%d_%H%M%S', localtime())
;
}
1;
}
1;