lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> My API delivers dates in the form yyyy-mm-dd but my design team wants DDD dd (i.e. Tue 14).

stamp="2011-06-14"
local y,m,d=stamp:match("(%d+)%-(%d+)%-(%d+)")
local t={year=y, month=m, day=d}
print(os.date("%a %d",os.time(t)))