Revision 0614d6da
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
SL/Common.pm | ||
---|---|---|
12 | 12 |
use strict; |
13 | 13 |
|
14 | 14 |
use Carp; |
15 |
use English qw(-no_match_vars); |
|
15 | 16 |
use Time::HiRes qw(gettimeofday); |
16 | 17 |
use Data::Dumper; |
17 | 18 |
use File::Copy; |
18 | 19 |
use File::stat; |
19 | 20 |
use File::Slurp; |
21 |
use POSIX (); |
|
20 | 22 |
|
21 | 23 |
use SL::DBUtils; |
22 | 24 |
|
... | ... | |
652 | 654 |
|
653 | 655 |
$::lxdebug->leave_sub(); |
654 | 656 |
} |
655 |
sub get_current_formatted_time { |
|
656 |
$main::lxdebug->enter_sub(); |
|
657 |
|
|
658 |
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); |
|
659 |
my $formatted_current_time = sprintf ( "_%04d%02d%02d_%02d%02d%02d", |
|
660 |
$year+1900,$mon+1,$mday,$hour,$min,$sec); |
|
661 | 657 |
|
662 |
$main::lxdebug->leave_sub();
|
|
663 |
return $formatted_current_time;
|
|
658 |
sub get_current_formatted_time {
|
|
659 |
return POSIX::strftime('_%Y%m%d_%H%M%S', localtime());
|
|
664 | 660 |
} |
665 | 661 |
|
666 | 662 |
1; |
Auch abrufbar als: Unified diff
Refactoring: Verwendung von POSIX::strftime anstelle von localtime() + sprintf