From 5e09acdd8e63cd6a2d245d6e458aa1dda7a9c87b Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Tue, 15 Apr 2008 13:56:57 +0000 Subject: A small modification (changed a variable name that collided with the libraryname that was loaded in the beginning of the code. git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@991 ab2d0c66-481e-0410-8bed-d214d4d58bed --- lib/date.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/date.lua b/lib/date.lua index cdc6ad0..d28cc74 100644 --- a/lib/date.lua +++ b/lib/date.lua @@ -9,7 +9,7 @@ require("fs") --global for date formating see below for more information --Mon Nov 26 19:56:10 UTC 2007 looks like most systems use this --print(os.date(date.format)) -format = "%a %b %d %X %Z %Y" +formats = "%a %b %d %X %Z %Y" months ={ {"January","Jan"}, {"February", "Feb"}, @@ -202,19 +202,19 @@ function seconds_to_date (t) g = {} count = table.maxn(t) for i = 1,count do - g[#g+1] = os.date(format,t[i]) + g[#g+1] = os.date(formats,t[i]) end return g end --Wed Nov 28 14:01:23 UTC 2007 ---os.date(date.format) put into a table +--os.date(date.formats) put into a table --year,month,day,hour,min,sec,isdst- may need a dst table to set this automatically function string_to_table (str) - if str == nil then str = os.date(format) end + if str == nil then str = os.date(formats) end g = {} - temp = format.string_to_table("%s",str) + temp = format.string_to_table(str,"%s") month = abr_month_num(temp[2]) g["month"] = month day = temp[3] @@ -223,7 +223,7 @@ function string_to_table (str) tz = temp[5] year = temp[6] g["year"] = year - temp2 = format.string_to_table(":",temp[4]) + temp2 = format.string_to_table(temp[4],":") hour = temp2[1] g["hour"] = hour min = temp2[2] -- cgit v1.2.3