Skip to content

Commit

Permalink
Merge pull request #20 from hadfl/localtime
Browse files Browse the repository at this point in the history
- call time() only once
  • Loading branch information
oetiker committed Jun 11, 2014
2 parents c64a28b + c24c16a commit 39e02d7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/ZnapZend/Time.pm
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,10 @@ sub getLastScrubTimestamp {

sub getLocalTimestamp {
my $self = shift;
my @t = localtime(time());
my $time = time();
my @t = localtime($time);

return time() + (timegm(@t) - timelocal(@t));
return $time + (timegm(@t) - timelocal(@t));
}

1;
Expand Down

0 comments on commit 39e02d7

Please sign in to comment.