<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.soldat.pl/index.php?action=history&amp;feed=atom&amp;title=TIniFile.ReadDateTime</id>
		<title>TIniFile.ReadDateTime - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.soldat.pl/index.php?action=history&amp;feed=atom&amp;title=TIniFile.ReadDateTime"/>
		<link rel="alternate" type="text/html" href="https://wiki.soldat.pl/index.php?title=TIniFile.ReadDateTime&amp;action=history"/>
		<updated>2026-05-05T23:26:35Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://wiki.soldat.pl/index.php?title=TIniFile.ReadDateTime&amp;diff=1098&amp;oldid=prev</id>
		<title>Mighty at 17:54, 22 August 2013</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat.pl/index.php?title=TIniFile.ReadDateTime&amp;diff=1098&amp;oldid=prev"/>
				<updated>2013-08-22T17:54:34Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 17:54, 22 August 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l10&quot; &gt;Line 10:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 10:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If it fails to do so for some reason, the ''Default'' value is returned.&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If it fails to do so for some reason, the ''Default'' value is returned.&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This function is very similar to [[TIniFile.ReadDate|ReadDate]], however, it includes an hour.&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This function is very similar to [[TIniFile.ReadDate|ReadDate]], however, it includes an hour.&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Important''': Result is a number of days that have passed since 1899-12-30 till date under the key in the ini file. Because of that, it's probably a good idea to use [[TIniFile.ReadString|ReadString]] to read a clarified date.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/ins&gt;'''Important''': Result is a number of days that have passed since 1899-12-30 till date under the key in the ini file. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/ins&gt;Because of that, it's probably a good idea to use [[TIniFile.ReadString|ReadString]] to read a clarified date.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; You could also encode it using one of the available [[:Category:Functions|Functions]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Example==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Example==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key soldatdevs-wiki:diff:version:1.11a:oldid:1053:newid:1098 --&gt;
&lt;/table&gt;</summary>
		<author><name>Mighty</name></author>	</entry>

	<entry>
		<id>https://wiki.soldat.pl/index.php?title=TIniFile.ReadDateTime&amp;diff=1053&amp;oldid=prev</id>
		<title>Mighty: new page</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat.pl/index.php?title=TIniFile.ReadDateTime&amp;diff=1053&amp;oldid=prev"/>
				<updated>2013-08-21T01:38:59Z</updated>
		
		<summary type="html">&lt;p&gt;new page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt; '''function ReadDateTime(const Section, Ident: string; Default: [[TDateTime]]): [[TDateTime]]'''&lt;br /&gt;
  Section: Section name&lt;br /&gt;
  Ident: Property name (key)&lt;br /&gt;
  Default: Value used as a result when the key has not been found&lt;br /&gt;
  Result: Value of a key (if successful) or ''Default'' (if not)&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
&lt;br /&gt;
This function will try to read a [[TDateTime]] value from specified section and key&amp;lt;br&amp;gt;&lt;br /&gt;
If it fails to do so for some reason, the ''Default'' value is returned.&amp;lt;br&amp;gt;&lt;br /&gt;
This function is very similar to [[TIniFile.ReadDate|ReadDate]], however, it includes an hour.&amp;lt;br&amp;gt;&lt;br /&gt;
'''Important''': Result is a number of days that have passed since 1899-12-30 till date under the key in the ini file. Because of that, it's probably a good idea to use [[TIniFile.ReadString|ReadString]] to read a clarified date.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
''example.ini'' in soldatserver's root folder&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[ModConfig]&lt;br /&gt;
Date1=2013-08-21&lt;br /&gt;
Date2=2013-08-21 12:00:00&lt;br /&gt;
Date3=2013-08-21 13:48:00&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
script code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;pascal&amp;quot;&amp;gt;&lt;br /&gt;
const&lt;br /&gt;
  // assuming Sandboxed Level &amp;lt; 2&lt;br /&gt;
  PATH = 'example.ini';&lt;br /&gt;
var&lt;br /&gt;
  Ini: TIniFile;&lt;br /&gt;
  temp: TDateTime; // could as well be  temp: Double;&lt;br /&gt;
&lt;br /&gt;
begin&lt;br /&gt;
  Ini := File.CreateINI(PATH);&lt;br /&gt;
  temp := Ini.ReadDateTime('ModConfig','Date1',0); // temp = 41507.0&lt;br /&gt;
  temp := Ini.ReadDateTime('ModConfig','Date2',0); // temp = 41507.5&lt;br /&gt;
  temp := Ini.ReadDateTime('ModConfig','Date3',0); // temp = 41507.575&lt;br /&gt;
  Ini.Free;&lt;br /&gt;
end.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:TIniFile]]&lt;/div&gt;</summary>
		<author><name>Mighty</name></author>	</entry>

	</feed>