aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Plugin/Timezone.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/Plugin/Timezone.pm b/Plugin/Timezone.pm
index 1e528ae..f10b3ca 100644
--- a/Plugin/Timezone.pm
+++ b/Plugin/Timezone.pm
@@ -27,15 +27,15 @@ sub time {
my $requester = (split /!/, $who)[0];
my @known_zones = (keys %{$config->{timezone}});
- return "Syntax: time [nick]" unless @arguments == 1;
+ return "Syntax: time [nick]" unless @arguments <= 1;
- my $nick = $arguments[0];
+ my $nick = $arguments[0] || $requester;
my ($case_nick) = grep {/^$nick$/i} @known_zones;
if ($case_nick) {
my $d = DateTime->now();
$d->set_time_zone($config->{timezone}->{$case_nick});
my $timestr = $d->strftime("%H:%M on %a %d %b, %Y (%Z)");
- return "$requester: $nick\'s clock reads $timestr";
+ return "$nick\'s clock reads $timestr";
} else {
return "$requester: I don't know what timezone $nick is in";
}