User:Phineas: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
No edit summary  | 
				No edit summary  | 
				||
| (3 intermediate revisions by the same user not shown) | |||
| Line 2: | Line 2: | ||
<syntaxhighlight lang="lua">  | <syntaxhighlight lang="lua">  | ||
function   | 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  | 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