<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.signature.net/skins/common/feed.css?270"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.signature.net/index.php?action=history&amp;feed=atom&amp;title=Get_DOS_Date</id>
		<title>Get DOS Date - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.signature.net/index.php?action=history&amp;feed=atom&amp;title=Get_DOS_Date"/>
		<link rel="alternate" type="text/html" href="http://wiki.signature.net/index.php?title=Get_DOS_Date&amp;action=history"/>
		<updated>2026-05-03T23:59:58Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.16.0</generator>

	<entry>
		<id>http://wiki.signature.net/index.php?title=Get_DOS_Date&amp;diff=1547&amp;oldid=prev</id>
		<title>Badge at 11:28, 13 June 2009</title>
		<link rel="alternate" type="text/html" href="http://wiki.signature.net/index.php?title=Get_DOS_Date&amp;diff=1547&amp;oldid=prev"/>
				<updated>2009-06-13T11:28:53Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 11:28, 13 June 2009&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 18:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 18:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; hex).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; hex).&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;&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: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''Discussion:'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''Discussion:'''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;br&amp;gt;&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The DOSMS function call can be used to get the DOS system date. This function requires that the AX-value be set to &amp;quot;@2A00@&amp;quot;, and that the other entry values be set to null. &amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The DOSMS function call can be used to get the DOS system date. This function requires that the AX-value be set to &amp;quot;@2A00@&amp;quot;, and that the other entry values be set to null. &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;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;After the function is executed, the DOS date is returned in the registers as described above. Note that the values are returned in hex and must be converted to decimal for meaningful use. &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;After the function is executed, the DOS date is returned in the registers as described above. Note that the values are returned in hex and must be converted to decimal for meaningful use. &amp;nbsp;&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''Special note:'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''Special note:'''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;br&amp;gt;&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The CX register returns the year portion of the DOS system date. In order to get the correct year, you must first reverse the order of the bytes in the CX register, and then convert to decimal. This is demonstrated in the following sample program. &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The CX register returns the year portion of the DOS system date. In order to get the correct year, you must first reverse the order of the bytes in the CX register, and then convert to decimal. This is demonstrated in the following sample program. &amp;nbsp;&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wikidb:diff:version:1.11a:oldid:1546:newid:1547 --&gt;
&lt;/table&gt;</summary>
		<author><name>Badge</name></author>	</entry>

	<entry>
		<id>http://wiki.signature.net/index.php?title=Get_DOS_Date&amp;diff=1546&amp;oldid=prev</id>
		<title>Badge at 11:28, 13 June 2009</title>
		<link rel="alternate" type="text/html" href="http://wiki.signature.net/index.php?title=Get_DOS_Date&amp;diff=1546&amp;oldid=prev"/>
				<updated>2009-06-13T11:28:22Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 11:28, 13 June 2009&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 8:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 8:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; CX-value = &amp;quot;@0000@&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; CX-value = &amp;quot;@0000@&amp;quot;&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; DX-value = &amp;quot;@0000@&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; DX-value = &amp;quot;@0000@&amp;quot;&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: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''Return:''' &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''Return:''' &amp;nbsp;&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; The CX register contains the year (1980 to 2099; in hex -- see conversion note below).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; The CX register contains the year (1980 to 2099; in hex -- see conversion note below).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wikidb:diff:version:1.11a:oldid:1545:newid:1546 --&gt;
&lt;/table&gt;</summary>
		<author><name>Badge</name></author>	</entry>

	<entry>
		<id>http://wiki.signature.net/index.php?title=Get_DOS_Date&amp;diff=1545&amp;oldid=prev</id>
		<title>Badge: New page: '''Get DOS Date'''  '''Syntax:'''   DOSMS(AX-value,BX-value,CX-value,DX-value) EXCP=statement-label   '''Entry:'''   AX-value = &quot;@2A00@&quot;   BX-value = &quot;@0000@&quot;   CX-value = &quot;@0000@&quot;   DX-va...</title>
		<link rel="alternate" type="text/html" href="http://wiki.signature.net/index.php?title=Get_DOS_Date&amp;diff=1545&amp;oldid=prev"/>
				<updated>2009-06-13T11:27:43Z</updated>
		
		<summary type="html">&lt;p&gt;New page: &amp;#39;&amp;#39;&amp;#39;Get DOS Date&amp;#39;&amp;#39;&amp;#39;  &amp;#39;&amp;#39;&amp;#39;Syntax:&amp;#39;&amp;#39;&amp;#39;   DOSMS(AX-value,BX-value,CX-value,DX-value) EXCP=statement-label   &amp;#39;&amp;#39;&amp;#39;Entry:&amp;#39;&amp;#39;&amp;#39;   AX-value = &amp;quot;@2A00@&amp;quot;   BX-value = &amp;quot;@0000@&amp;quot;   CX-value = &amp;quot;@0000@&amp;quot;   DX-va...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''Get DOS Date'''&lt;br /&gt;
&lt;br /&gt;
'''Syntax:'''&lt;br /&gt;
  DOSMS(AX-value,BX-value,CX-value,DX-value) EXCP=statement-label  &lt;br /&gt;
'''Entry:'''&lt;br /&gt;
  AX-value = &amp;quot;@2A00@&amp;quot;&lt;br /&gt;
  BX-value = &amp;quot;@0000@&amp;quot;&lt;br /&gt;
  CX-value = &amp;quot;@0000@&amp;quot;&lt;br /&gt;
  DX-value = &amp;quot;@0000@&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Return:''' &lt;br /&gt;
  The CX register contains the year (1980 to 2099; in hex -- see conversion note below).&lt;br /&gt;
                                                                                                                         .&lt;br /&gt;
  Byte 2 of the DX register (i.e., the DH byte) contains the month (1 to 12; in hex).&lt;br /&gt;
                                                                                                                          .&lt;br /&gt;
  Byte 1 of the DX register (i.e., the DL byte) contains the day (1 to 31; in hex).&lt;br /&gt;
                                                                                                                          .&lt;br /&gt;
  Byte 1 of the AX register (i.e., the AL byte) contains the weekday number (0 = Sunday, 1 = Monday, 2 = Tuesday, etc.; in&lt;br /&gt;
  hex).&lt;br /&gt;
 &lt;br /&gt;
'''Discussion:'''&lt;br /&gt;
The DOSMS function call can be used to get the DOS system date. This function requires that the AX-value be set to &amp;quot;@2A00@&amp;quot;, and that the other entry values be set to null. &amp;lt;br&amp;gt;&lt;br /&gt;
After the function is executed, the DOS date is returned in the registers as described above. Note that the values are returned in hex and must be converted to decimal for meaningful use. &lt;br /&gt;
&lt;br /&gt;
'''Special note:'''&lt;br /&gt;
The CX register returns the year portion of the DOS system date. In order to get the correct year, you must first reverse the order of the bytes in the CX register, and then convert to decimal. This is demonstrated in the following sample program. &lt;br /&gt;
 &lt;br /&gt;
'''Example:'''&lt;br /&gt;
  ! S SDATE,DSK&lt;br /&gt;
  ! O DATE,DSK&lt;br /&gt;
  ! L T00,E&lt;br /&gt;
  ! R QMONITOR&lt;br /&gt;
  !&lt;br /&gt;
  !==========  GET DOS DATE =======================================&lt;br /&gt;
  !&lt;br /&gt;
  LENGTH 2 &amp;amp; LOCAL AX$,BX$,CX$,DX$          ! Define registers&lt;br /&gt;
             LOCAL MONTH$,DAYNUM$,WEEKDAY$  ! Define date variables&lt;br /&gt;
  LENGTH 4 &amp;amp; LOCAL YEAR$                    ! Define year&lt;br /&gt;
  LENGTH 1 &amp;amp; LOCAL AL$,CH$,CL$,DH$,DL$      ! Define sub-registers&lt;br /&gt;
  LENGTH 4.0 &amp;amp; LOCAL YEAR                   ! Define numeric year&lt;br /&gt;
  LENGTH 2.0 &amp;amp; LOCAL MONTH,DAYNUM,WEEKDAY   ! Define numeric dates&lt;br /&gt;
  !&lt;br /&gt;
  100 FORMAT (ET)                           ! Screen format&lt;br /&gt;
  !&lt;br /&gt;
  CLEAR                        ! Initialize all variables&lt;br /&gt;
  !&lt;br /&gt;
  AX$=&amp;quot;@2A00@&amp;quot;                 ! Set AX register for &amp;quot;GET DATE&amp;quot;&lt;br /&gt;
  BX$=&amp;quot;@0000@&amp;quot;                 ! Set BX register to null&lt;br /&gt;
  CX$=&amp;quot;@0000@&amp;quot;                 ! Set CX register to null&lt;br /&gt;
  DX$=&amp;quot;@0000@&amp;quot;                 ! Set DX register to null&lt;br /&gt;
  !&lt;br /&gt;
  DOSMS(AX$,BX$,CX$,DX$)       ! Perform DOSMS system call&lt;br /&gt;
  !&lt;br /&gt;
  YEAR$ = CX$                  ! Year (hex) = CX register&lt;br /&gt;
  MONTH$= SUB(DX$,2,1)         ! Month (hex) = DH byte of DX&lt;br /&gt;
  DAYNUM$= SUB(DX$,1,1)        ! Day (hex) = DL byte of DX register&lt;br /&gt;
  WEEKDAY$=SUB(AX$,1,1)        ! Weekday (hex) = AL byte of AX&lt;br /&gt;
  !&lt;br /&gt;
  CH$ = SUB(CX$,2,1)           ! Get CH byte from CX (year)&lt;br /&gt;
  CL$ = SUB(CX$,1,1)           ! Get CL byte from CX (year)&lt;br /&gt;
  YEAR$ = CH$ + CL$            ! Recombine CH and CL bytes&lt;br /&gt;
  !&lt;br /&gt;
  MONTH$   = &amp;quot;@00@&amp;quot; + MONTH$   ! Add leading null byte to MONTH$&lt;br /&gt;
  DAYNUM$  = &amp;quot;@00@&amp;quot; + DAYNUM$  ! Add leading null byte to DAYNUM$&lt;br /&gt;
  WEEKDAY$ = &amp;quot;@00@&amp;quot; + WEEKDAY$ ! Add leading null byte to WEEKDAY$&lt;br /&gt;
  !&lt;br /&gt;
  YEAR = HEXDEC(YEAR$)         ! Convert hex YEAR$ to decimal YEAR&lt;br /&gt;
  MONTH= HEXDEC(MONTH$)        ! Convert hex MONTH$ to decimal&lt;br /&gt;
  DAYNUM = HEXDEC(DAYNUM$)     ! Convert hex DAYNUM$ to decimal&lt;br /&gt;
  WEEKDAY= HEXDEC(WEEKDAY$)    ! Convert hex WEEKDAY$ to decimal&lt;br /&gt;
  !&lt;br /&gt;
  PRINT (0,100)                ! Set typewriter mode&lt;br /&gt;
  !&lt;br /&gt;
  PRINT (0) &amp;quot;YEAR:      &amp;quot;;YEAR&lt;br /&gt;
  PRINT (0) &amp;quot;MONTH:     &amp;quot;;MONTH&lt;br /&gt;
  PRINT (0) &amp;quot;DAY        &amp;quot;;DAYNUM&lt;br /&gt;
  PRINT (0) &amp;quot;WEEKDAY # :&amp;quot;;WEEKDAY&lt;br /&gt;
  INPUT (0) &amp;quot;&amp;quot;&lt;br /&gt;
  RUN &amp;quot;QMONITOR&amp;quot;&lt;br /&gt;
  END&lt;/div&gt;</summary>
		<author><name>Badge</name></author>	</entry>

	</feed>