diff --git a/lua/time/main.lua b/lua/time/main.lua new file mode 100644 index 0000000..17b7115 --- /dev/null +++ b/lua/time/main.lua @@ -0,0 +1,15 @@ + +-- 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}, "-"))