diff -r dc0c8914ac04 -r 6700d4722be7 readdate.lua --- a/readdate.lua Sun Jun 21 19:12:26 2009 +0100 +++ b/readdate.lua Sun Jun 21 19:13:16 2009 +0100 @@ -4,11 +4,16 @@ local base; for line in io.lines() do - if line:match("^base:%d+$") then + if line:match("^base:") then + -- Set the unixtime to calculate relative to, eg. base:0 base = tonumber(line:match("^base:(%d+)$")); else - local ret = ndp.when(line, base); - print(os.date("%c", ret).." ("..ret..")"); + local ret, start, finish = ndp.when(line, base); + local remaining = ""; + if start and finish then + remaining = (line:sub(1, start)..line:sub(finish, -1)):gsub("^[%s%p]+", ""):gsub("[%s%p]+$", ""); + end + print(os.date("%c", ret).." ("..ret..")"..((#remaining>0 and (": "..remaining)) or "")); end end