User:Phineas: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 17: | Line 17: | ||
secs = "0" ..tostring(secs) | secs = "0" ..tostring(secs) | ||
end | end | ||
local TimeStamp = | local TimeStamp = day .. "-" .. month .. "-" .. year .. " " .. hours .. ":" .. mins .. ":" .. secs | ||
return TimeStamp | return TimeStamp | ||
end | end | ||
</syntaxhighlight> | </syntaxhighlight> |
Latest revision as of 16:03, 18 March 2013
Sup
function getTimestamp() local RTime = getRealTime() local year, month, day, hours, mins, secs = RTime.year + 1900, RTime.month + 1, RTime.monthday, RTime.hour, RTime.minute, RTime.second if (month < 10) then month = "0" ..tostring(month) end if (hours < 10) then hours = "0" ..tostring(hours) end if (mins < 10) then mins = "0" ..tostring(mins) end if (secs < 10) then secs = "0" ..tostring(secs) end local TimeStamp = day .. "-" .. month .. "-" .. year .. " " .. hours .. ":" .. mins .. ":" .. secs return TimeStamp end