<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.harlamenkov.ru/index.php?action=history&amp;feed=atom&amp;title=EN%2Fdocumentation%2Fbasic_guide%2Fdate_and_time_runtime_library</id>
	<title>EN/documentation/basic guide/date and time runtime library - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.harlamenkov.ru/index.php?action=history&amp;feed=atom&amp;title=EN%2Fdocumentation%2Fbasic_guide%2Fdate_and_time_runtime_library"/>
	<link rel="alternate" type="text/html" href="https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/date_and_time_runtime_library&amp;action=history"/>
	<updated>2026-11-11T13:55:48Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/date_and_time_runtime_library&amp;diff=15939&amp;oldid=prev</id>
		<title>Sancho at 16:52, 2 September 2011</title>
		<link rel="alternate" type="text/html" href="https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/date_and_time_runtime_library&amp;diff=15939&amp;oldid=prev"/>
		<updated>2011-09-02T16:52:51Z</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 class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 16:52, 2 September 2011&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-l5&quot; &gt;Line 5:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|ShowPrevNext=block&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|ShowPrevNext=block&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;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|ShowPrevPage=block&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|ShowPrevPage=block&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: #222; 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;|PrevPage=EN/documentation/basic_guide/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;strings_(runtime_library)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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;|PrevPage=EN/documentation/basic_guide/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;strings_runtime_library&lt;/ins&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: #222; 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;|NextPage=EN/documentation/basic_guide/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;files_and_directories_(runtime_library)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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;|NextPage=EN/documentation/basic_guide/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;files_and_directories_runtime_library&lt;/ins&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;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|runtime=block&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|runtime=block&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;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sancho</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/date_and_time_runtime_library&amp;diff=15934&amp;oldid=prev</id>
		<title>Sancho: moved EN/documentation/basic guide/date and time (runtime library) to EN/documentation/basic guide/date and time runtime library</title>
		<link rel="alternate" type="text/html" href="https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/date_and_time_runtime_library&amp;diff=15934&amp;oldid=prev"/>
		<updated>2011-09-02T16:45:21Z</updated>

		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/index.php?title=EN/documentation/basic_guide/date_and_time_(runtime_library)&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;EN/documentation/basic guide/date and time (runtime library) (page does not exist)&quot;&gt;EN/documentation/basic guide/date and time (runtime library)&lt;/a&gt; to &lt;a href=&quot;/wiki/EN/documentation/basic_guide/date_and_time_runtime_library&quot; title=&quot;EN/documentation/basic guide/date and time runtime library&quot;&gt;EN/documentation/basic guide/date and time runtime library&lt;/a&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 16:45, 2 September 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Sancho</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/date_and_time_runtime_library&amp;diff=15901&amp;oldid=prev</id>
		<title>Sancho: Основной текст</title>
		<link rel="alternate" type="text/html" href="https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/date_and_time_runtime_library&amp;diff=15901&amp;oldid=prev"/>
		<updated>2011-09-02T10:42:23Z</updated>

		<summary type="html">&lt;p&gt;Основной текст&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;section begin=title /&amp;gt;&amp;lt;noinclude&amp;gt;{{DISPLAYTITLE:&amp;lt;/noinclude&amp;gt;Date and Time ({{OOo}} Runtime Library)&amp;lt;noinclude&amp;gt;}}&amp;lt;/noinclude&amp;gt;&amp;lt;section end=title /&amp;gt;{{BreadCrumbL10n}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Documentation/BASICGuideTOC&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|ShowPrevPage=block&lt;br /&gt;
|PrevPage=EN/documentation/basic_guide/strings_(runtime_library)&lt;br /&gt;
|NextPage=EN/documentation/basic_guide/files_and_directories_(runtime_library)&lt;br /&gt;
|runtime=block&lt;br /&gt;
}}&lt;br /&gt;
 &lt;br /&gt;
{{OOo}} Basic provides the &amp;lt;tt&amp;gt;Date&amp;lt;/tt&amp;gt; data type, which saves the date and time details in binary format.&lt;br /&gt;
&lt;br /&gt;
== Specification of Date and Time Details within the Program Code ==&lt;br /&gt;
&lt;br /&gt;
You can assign a date to a date variable through the assignment of a simple string:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim MyDate As Date&lt;br /&gt;
MyDate = &amp;quot;24.1.2002&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This assignment can function properly because {{OOo}} Basic automatically converts the date value defined as a string into a date variable. This type of assignment, however, can cause errors, date and time values are defined and displayed differently in different countries.&lt;br /&gt;
&lt;br /&gt;
Since {{OOo}} Basic uses the country-specific settings of the operating system when converting a string into a date value, the expression shown previously only functions correctly if the country-specific settings match the string expression.&lt;br /&gt;
&lt;br /&gt;
To avoid this problem, the &amp;lt;tt&amp;gt;DateSerial&amp;lt;/tt&amp;gt; function should be used to assign a fixed value to a date variable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim MyVar As Date&lt;br /&gt;
MyDate = DateSerial (2001, 1, 24)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function parameter must be in the sequence: year, month, day. The function ensures that the variable is actually assigned the correct value regardless of the country-specific settings &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;TimeSerial&amp;lt;/tt&amp;gt; function formats time details in the same way that the &amp;lt;tt&amp;gt;DateSerial&amp;lt;/tt&amp;gt; function formats dates:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim MyVar As Date&lt;br /&gt;
MyDate =  TimeSerial(11, 23, 45)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Their parameters should be specified in the sequence: hours, minutes, seconds.&lt;br /&gt;
&lt;br /&gt;
== Extracting Date and Time Details ==&lt;br /&gt;
&lt;br /&gt;
The following functions form the counterpart to the &amp;lt;tt&amp;gt;DateSerial&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;TimeSerial&amp;lt;/tt&amp;gt; functions:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;Day(MyDate)&amp;lt;/tt&amp;gt;:returns the day of the month from &amp;lt;tt&amp;gt;MyDate&amp;lt;/tt&amp;gt;.&lt;br /&gt;
;&amp;lt;tt&amp;gt;Month(MyDate)&amp;lt;/tt&amp;gt;:returns the month from &amp;lt;tt&amp;gt;MyDate&amp;lt;/tt&amp;gt;.&lt;br /&gt;
;&amp;lt;tt&amp;gt;Year(MyDate)&amp;lt;/tt&amp;gt;:returns the year from &amp;lt;tt&amp;gt;MyDate&amp;lt;/tt&amp;gt;.&lt;br /&gt;
;&amp;lt;tt&amp;gt;Weekday(MyDate)&amp;lt;/tt&amp;gt;:returns the number of the weekday from &amp;lt;tt&amp;gt;MyDate&amp;lt;/tt&amp;gt;.&lt;br /&gt;
;&amp;lt;tt&amp;gt;Hour(MyTime)&amp;lt;/tt&amp;gt;:returns the hours from &amp;lt;tt&amp;gt;MyTime&amp;lt;/tt&amp;gt;.&lt;br /&gt;
;&amp;lt;tt&amp;gt;Minute(MyTime)&amp;lt;/tt&amp;gt;:returns the minutes from &amp;lt;tt&amp;gt;MyTime&amp;lt;/tt&amp;gt;.&lt;br /&gt;
;&amp;lt;tt&amp;gt;Second(MyTime)&amp;lt;/tt&amp;gt;:returns the seconds from &amp;lt;tt&amp;gt;MyTime&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These functions extract the date or time sections from a specified &amp;lt;tt&amp;gt;Date&amp;lt;/tt&amp;gt; variable. The following example checks whether the date saved in &amp;lt;tt&amp;gt;MyDate&amp;lt;/tt&amp;gt; is in the year 2003. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim MyDate As Date&lt;br /&gt;
' ... Initialization of MyDate&lt;br /&gt;
&lt;br /&gt;
If Year(MyDate) = 2003 Then&lt;br /&gt;
  ' ... Specified date is in the year 2003&lt;br /&gt;
End If&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the same way, the following example checks whether &amp;lt;tt&amp;gt;MyTime&amp;lt;/tt&amp;gt; is between 12 and 14 hours.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim MyTime As Date&lt;br /&gt;
' ... Initialization of MyTime&lt;br /&gt;
&lt;br /&gt;
If Hour(MyTime) &amp;gt;= 12 And Hour(MyTime) &amp;lt; 14 Then&lt;br /&gt;
  ' ... Specified time is between 12 and 14 hours&lt;br /&gt;
End If&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Weekday&amp;lt;/tt&amp;gt; function returns the number of the weekday for the transferred date: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim MyDate As Date&lt;br /&gt;
Dim MyWeekday As String&lt;br /&gt;
' ... initialize MyDate&lt;br /&gt;
&lt;br /&gt;
Select Case WeekDay(MyDate)&lt;br /&gt;
  case 1&lt;br /&gt;
    MyWeekday = &amp;quot;Sunday&amp;quot;&lt;br /&gt;
  case 2&lt;br /&gt;
    MyWeekday = &amp;quot;Monday&amp;quot;&lt;br /&gt;
  case 3&lt;br /&gt;
    MyWeekday = &amp;quot;Tuesday&amp;quot;&lt;br /&gt;
  case 4&lt;br /&gt;
    MyWeekday = &amp;quot;Wednesday&amp;quot;&lt;br /&gt;
  case 5&lt;br /&gt;
    MyWeekday = &amp;quot;Thursday&amp;quot;&lt;br /&gt;
  case 6&lt;br /&gt;
    MyWeekday = &amp;quot;Friday&amp;quot;&lt;br /&gt;
  case 7&lt;br /&gt;
    MyWeekday = &amp;quot;Saturday&amp;quot;&lt;br /&gt;
End Select&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|Sunday is considered the first day of the week.}}&lt;br /&gt;
&lt;br /&gt;
== Retrieving System Date and Time ==&lt;br /&gt;
&lt;br /&gt;
The following functions are available in {{OOo}} Basic to retrieve the system time and system date:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;Date&amp;lt;/tt&amp;gt;:returns the present date as a string. The format depends on localization settings.&lt;br /&gt;
;&amp;lt;tt&amp;gt;Time&amp;lt;/tt&amp;gt;:returns the present time as a string.&lt;br /&gt;
;&amp;lt;tt&amp;gt;Now&amp;lt;/tt&amp;gt;:returns the present point in time (date and time) as a combined value of type &amp;lt;tt&amp;gt;Date&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
{{PDL1}}&lt;/div&gt;</summary>
		<author><name>Sancho</name></author>
		
	</entry>
</feed>