From 284bcbf4b29184717cd2e0986d4c2007ee6a930c Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Mon, 27 Sep 2010 12:38:59 +0200 Subject: time: support POSIX time --- data/rbot/plugins/time.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'data/rbot') diff --git a/data/rbot/plugins/time.rb b/data/rbot/plugins/time.rb index 854e403d..efea466f 100644 --- a/data/rbot/plugins/time.rb +++ b/data/rbot/plugins/time.rb @@ -159,8 +159,12 @@ class TimePlugin < Plugin offset = (time - now).abs raise if offset < 0.1 rescue => e - m.reply _("unintelligible time") - return + if str.match(/^\d+$/) + time = Time.at(str.to_i) + else + m.reply _("unintelligible time") + return + end end if zone = @registry[m.sourcenick] -- cgit v1.2.3