# DOS DATE AND TIME STAMPS

``` BBS: Inland Empire Archive
Date: 03-19-93 (09:47)             Number: 332
From: PETER BARNEY                 Refer#: NONE
To: ROBERT CHURCH                 Recvd: NO
Subj: DOS DATE AND TIME STAMPS       Conf: (2) Quik_Bas```
```RC>How do you convert the bit-mapped DOS date and time stamps in the DTA to QB
RC>useable variables?  I'd like to convert them to INTEGERs for:

RC>Month%, Day%, Year%, Hour%, Minute%, Second%

Here's the actual code to do the convert, without everything else:

fd! = CVI(MID\$(DTA\$, 25, 2))
year = (fd! AND &HFE00) \ 512 + 80
month = (fd! AND &H1E0) \ 32
day = fd! AND &H1F

ft! = CVI(MID\$(DTA\$, 23, 2))
hour = (ft! AND &HF800) \ 2048
minute = (ft! AND &H7E0) \ 32
second = (ft! AND 31) * 2

Note: the seconds are stored in increments of two, so you'll never have an odd
number of seconds.

* SLMR 2.1 * Strike any user to continue.

--- TMail v1.31.2
* Origin: Programmer's Tech Shop (1:234/56)
```

Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET