Q(uick)BASIC Numbers: Serial
Quick View
Serial Numbers
A serial number is a date/time code used by BASIC to represent dates and times between January 1, 1753 and December 31, 2078
Worth knowing
Useful and cross-version information about the programming environments of QBasic and QuickBasic.
Description/Parameter(s)
- Numbers to the left of the decimal point represent the date; numbers to the right of the decimal point represent the time. For example:
This serial number | Represents this date |
20323.25 | August 22, 1955 6:00 AM |
20324.25 | August 23, 1955 6:00 AM |
367.5 | January 1, 1901 12:00 PM |
367.75 | January 1, 1901 6:00 PM |
- A serial number with no fractional part represents a date only. A serial number with only a fractional part represents a time only.
- The date portion of the serial number (to the left of the decimal point) can represent dates ranging from January 1, 1753, through December 31, 2078. Dates before December 30, 1899 are represented by negative numbers; dates after December 30 are represented by positive numbers:
This serial number | Represents this date |
-1 | December 29, 1899 |
0 | December 30, 1899 |
1 | December 31, 1899 |
2 | January 1, 1900 |
- The time portion of the serial number (to the right of the decimal point) can represent times that range from 0 (00:00:00 AM) to .99999 (11:59:59 PM or 23:59:59).