readdate.lua

Sun, 21 Jun 2009 17:42:50 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Sun, 21 Jun 2009 17:42:50 +0100
changeset 0
44416491923e
child 3
487f8d7b81b7
permissions
-rw-r--r--

Initial commit of ndp, the natural date processing library

local ndp = require "ndp";

local base;
for line in io.lines() do
	if line:match("^base:%d+$") then
		base = tonumber(line:match("^base:(%d+)$"));
	else
		local ret = ndp.when(line, 0, base);
		print(os.date("%c", ret).." ("..ret..")");
	end
end

mercurial