16 lines
524 B
Lua
16 lines
524 B
Lua
|
|
||
|
-- Create a table named time to store current time
|
||
|
time = os.date("*t")
|
||
|
|
||
|
-- Old stand by
|
||
|
print (time.year .. "-" .. time.month .. "-" .. time.day)
|
||
|
|
||
|
-- Allow for beter control, seems to print up to 2 decimal places
|
||
|
-- Not actually sure how this works
|
||
|
-- The first number seems to add perceding spaces
|
||
|
-- The second number seems to add perceding 0's
|
||
|
print (("%02d-%02d-%02d"):format(time.year, time.month, time.day))
|
||
|
|
||
|
-- Concat with a deliminator noted at the end
|
||
|
print (table.concat({time.year, time.month, time.day}, "-"))
|