<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Coget4</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Coget4"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Coget4"/>
	<updated>2026-05-11T03:13:45Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetResourceLoadTime&amp;diff=52608</id>
		<title>GetResourceLoadTime</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetResourceLoadTime&amp;diff=52608"/>
		<updated>2017-10-18T10:29:55Z</updated>

		<summary type="html">&lt;p&gt;Coget4: Fixed typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
Gets the date and time at which a resource was last loaded in the server.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
{{New feature/item|3|1.0|840|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int getResourceLoadTime ( resource res )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
{{Deprecated_feature|3|1.0|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getResourceLoadTime ( resource res )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''res:''' the resource you want to know the load time of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
{{New feature|3|1.0 r840|&lt;br /&gt;
If successful, returns the UNIX timestamp when the resource was loaded, otherwise false. Use in conjunction with [[getRealTime]] in order to retrieve detailed information. &lt;br /&gt;
}}&lt;br /&gt;
{{Deprecated_feature|3|1.0|&lt;br /&gt;
If successful, returns a string with the date and time that the resource was last loaded into memory (for example when the server started, or when the resource was changed and reloaded). Returns ''false'' on failure.&lt;br /&gt;
&lt;br /&gt;
An example string is &amp;quot;Fri Mar 28 13:51:04 2008&amp;quot;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This code outputs the date and time at which the scoreboard resource was last loaded.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; class=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
local res = getResourceFromName ( &amp;quot;scoreboard&amp;quot; )&lt;br /&gt;
if res then&lt;br /&gt;
    local time = getRealTime(getResourceLoadTime(res)) --Gets all the data we need from UNIX time format, see getRealTime() for more details&lt;br /&gt;
    outputConsole ( &amp;quot;scoreboard was last loaded on: &amp;quot; ..  string.format(&amp;quot;%i/%i/%i %i:%i:%i&amp;quot;,time.monthday,time.month,time.year,time.hour,time.minute,time.second)) --this will be something like this: scoreboard was last loaded on: 10/07/2017 14:13:10&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This code outputs the date and time at which the specified resource started.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; class=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
function getLoadTime(p,c,res)&lt;br /&gt;
	local resource = getResourceFromName(tostring(res))&lt;br /&gt;
	if not res or not resource then&lt;br /&gt;
		outputChatBox(&amp;quot;Syntax: /&amp;quot; .. c .. &amp;quot; [Resource Name]&amp;quot;)&lt;br /&gt;
	else&lt;br /&gt;
		local time = getRealTime(getRealTime().timestamp-getResourceLoadTime(resource))&lt;br /&gt;
		outputChatBox(&amp;quot;The resource &amp;quot; .. res .. &amp;quot; started at &amp;quot; .. string.format(&amp;quot;%i/%i/%i %i:%i:%i&amp;quot;,time.monthday,time.month,time.year,time.hour,time.minute,time.second))&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;getResourceLoadTime&amp;quot;, getLoadTime, false,false) --adds the command handler&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource functions}}&lt;/div&gt;</summary>
		<author><name>Coget4</name></author>
	</entry>
</feed>