UnixTime: Disable the no argument feature.

Disabling the no argument feature since:
- It triggers with just "time"
- The time shown doesn't follow the person's timezone (which is preferable over UTC)
master
jagtalon 2014-08-25 18:52:58 +00:00
parent 8dcb55792c
commit 80ee10d13a
2 changed files with 4 additions and 4 deletions

View File

@ -20,9 +20,9 @@ category 'calculations';
topics 'sysadmin';
handle remainder => sub {
return unless defined $_;
my $time_input = shift;
$time_input = time if ($time_input eq ''); # Default to 'now' when empty.
my $time_utc;
eval {
$time_input = int(length($time_input) >= 13 ? ($time_input / 1000) : ($time_input + 0));

View File

@ -15,9 +15,9 @@ ddg_goodie_test([qw(
'unix time 0000000000000' => test_zci('Unix Time: Thu Jan 01 00:00:00 1970 +0000'),
'epoch 0' => test_zci('Unix Time: Thu Jan 01 00:00:00 1970 +0000'),
'epoch 2147483647' => test_zci('Unix Time: Tue Jan 19 03:14:07 2038 +0000'),
'epoch' => test_zci(qr/Unix Time: [^\+]+\+0000/), # Now in UTC.
'timestamp' => test_zci(qr/Unix Time: [^\+]+\+0000/), # Now in UTC.
'datetime' => test_zci(qr/Unix Time: [^\+]+\+0000/), # Now in UTC.
#'epoch' => test_zci(qr/Unix Time: [^\+]+\+0000/), # Now in UTC.
#'timestamp' => test_zci(qr/Unix Time: [^\+]+\+0000/), # Now in UTC.
#'datetime' => test_zci(qr/Unix Time: [^\+]+\+0000/), # Now in UTC.
);
done_testing;