The first argument passed to os.date() is the format string. I've seen people use *t and !*t as the format string.
Is there a difference between the two?
The first argument passed to os.date() is the format string. I've seen people use *t and !*t as the format string.
Is there a difference between the two?
The lua ref manual describes this:
If format starts with '!', then the date is formatted in Coordinated Universal Time
These two examples show the difference:
local t = os.date( "!%a %b %d, %H:%M")
print(t) -- Thu Oct 25, 04:01 (current UTC)
local t = os.date( "%a %b %d, %H:%M")
print(t) -- Thu Oct 25, 12:01