Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

date: unused var #287

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions bin/date
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ sub munge_tz {
my $from_posix = posix_tz();
return $from_posix if $from_posix =~ m/\A[A-Z]{3,4}\z/;
my $from_windows = windows_time_zones();
# print "# from POSIX: $from_posix\n";
my $i_dst = (core_time())[-1] ? -1 : 0; # some only have one entry, so two would be the same

return $from_windows->{$from_posix}[$i_dst] if exists $from_windows->{$from_posix};
Expand All @@ -57,8 +56,7 @@ sub quarter {
}

sub run {
my( $args, $time ) = @_;
$time = defined $time ? $time : time;
my $args = shift;
*core_time = do {
my @times = CORE::localtime;
sub { @times }
Expand All @@ -80,9 +78,7 @@ sub run {
if( /^\-u/ ) { $TZ = $ENV{'TZ'} = 'UTC'; my @times = CORE::gmtime; *core_time = sub { @times } }
}

my $format;
$format = select_format( @$args );

my $format = select_format(@$args);
my $specifiers = setup_specifiers();

$format =~ s/%(:?.)/ exists $specifiers->{$1} ? $specifiers->{$1} : "%$1" /eg;
Expand Down