diff -r 522bf1c3dd7c -r f4034a59feaa bvv2cal --- a/bvv2cal Fri Nov 12 09:23:02 2010 +0100 +++ b/bvv2cal Fri Nov 12 10:56:02 2010 +0100 @@ -41,6 +41,11 @@ ["ß"] = "ss" } +local function local2gmt(y, m, d, hour, min) + return os.date("%s", os.time { day=d, month=m, year=y, hour=hour, min=min }) +end + + local state = "waitcontent" local record, cell, result = { }, { }, { } local lnr = 1 @@ -78,8 +83,8 @@ end if sH then -- convert dates to GMT - local startdate = os.date("!%s", os.time { day=d, month=m, year=y, hour=sH, min=sM }) - local enddate = eH and os.date("!%s", os.time { day=d, month=m, year=y, hour=eH, min=eM }) + local startdate = local2gmt(y, m, d, sH, sM) + local enddate = eH and local2gmt(y, m, d, eH, eM) local what = table.concat(record, " "):match("^%s*(.-)%s*$") what = what:gsub("([\128-\255].)", umlconv) table.insert(result, { startdate, enddate, what }) @@ -122,12 +127,12 @@ for i = 1, #result do local r = result[i] print "BEGIN:VEVENT" - local startdate = os.date("%Y%m%dT%H%M", r[1]) + local startdate = os.date("!%Y%m%dT%H%M", r[1]) print("UID:" .. startdate .. "." .. uid_uri) print("SUMMARY:" .. r[3]) print("DTSTART:" .. startdate .. "00Z") if r[2] then - local enddate = r[2] and os.date("%Y%m%dT%H%M", r[2]) + local enddate = r[2] and os.date("!%Y%m%dT%H%M", r[2]) print("DTEND:" .. enddate .. "00Z") end print "END:VEVENT"