All pastes #370795 Raw Edit

Cirex

public lua v1 · immutable
#370795 ·published 2007-02-24 21:35 UTC
rendered paste body
function Difference( Start, Quanity = 4 )	local Seconds = os.time() - Start;		Time["Week"] = math.floor( Seconds / 604800 );	Seconds = math.mod( Seconds, 604800 );		Time["Day"] = math.floor( Seconds / 86400 );	Seconds = math.mod( Seconds, 86400 );		Time["Hour"] = math.floor( Seconds / 3600 );	Seconds = math.mod( Seconds, 3600 );		Time["Minute"] = math.floor( Seconds / 60 );	Time["Second"] = math.mod( Seconds, 60 );		local I = 0;	for Key, Value in pairs(Time) do		if ( I > Quanity ) then			break;		elseif ( Value != 0 ) then			if ( Value > 1 ) then				Key ..= "s";			end;						Str ..= ( Str == nil ) ? ", " .. Value .. " " ..Key : Value .. " " .. Key;			I = I + 1;		end;	end;		return Str;	end;