summaryrefslogtreecommitdiffstats
path: root/lib/date.lua
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2008-04-15 13:56:57 +0000
committerMika Havela <mika.havela@gmail.com>2008-04-15 13:56:57 +0000
commit5e09acdd8e63cd6a2d245d6e458aa1dda7a9c87b (patch)
treef8c5e442afa6078444cded78123144421976e521 /lib/date.lua
parent2a4eeefb2bf03fb829a48b86135958e0126fe11c (diff)
downloadacf-core-5e09acdd8e63cd6a2d245d6e458aa1dda7a9c87b.tar.bz2
acf-core-5e09acdd8e63cd6a2d245d6e458aa1dda7a9c87b.tar.xz
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
Diffstat (limited to 'lib/date.lua')
-rw-r--r--lib/date.lua12
1 files changed, 6 insertions, 6 deletions
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]