Dec 132017
 
Visual Basic Program with source that displays Date and Time in various formats.
File DATTIM.ZIP from The Programmer’s Corner in
Category BASIC Language
Visual Basic Program with source that displays Date and Time in various formats.
File Name File Size Zip Size Zip Type
DATETIM1.FRM 9527 4387 deflated
DATETIM2.FRM 1160 527 deflated
DATETIME.BAS 15515 4068 deflated
DATETIME.EXE 22977 9898 deflated
DATETIME.MAK 86 63 deflated
DATETIME.WRI 5760 2137 deflated
TPCREAD.ME 199 165 deflated

Download File DATTIM.ZIP Here

Contents of the DATETIME.WRI file


1(,,,,,-DateTime Help

DateTime, Copyright 1991 A.C.I. GmbH MicroSysteme Hans-Georg Michna [email protected] DateTime may be freely distributed but not sold. Please send self documenting code enhancements (i.e. improved source code with many embedded comments) to me or upload directly to CompuServe under the same file name.

Attention: You may alter this help file and add your own comments. Be sure to save your changes if you want them or do not save them if you did not want to make any changes but may have done so accidentally.

To have DateTime loaded automatically add it to WIN.INI, section [windows], item "load=". You may prefix it with a path if it is not on your DOS PATH. Example WIN.INI fragment:

[windows]
load=C:\APPS\MYPROG.EXE C:\UTILITY\DATETIME.EXE

For the Help command to work this help file must have the same name as the .EXE file except for the extension which must be .WRI, and it must be in the same directory with the .EXE file. Windows Write (WRITE.EXE) must also be available.

The last (seventh) format can be modified. Valid format string codes follow:

CodeMeaning
----------------------------------------------------------------------------------------------
/Shows the date delimiter as defined in the international part of WIN.INI (sDate=). Attention: Use quotation marks if you want other characters, for example: d"."m"."yy
dShows the day as a number without leading zeros (1-31).
ddShows the day as a number with leading zeros (01-31).
dddShows the day as three-letter abbreviation (Sun-Sat).
ddddShows the day with its full name (Sunday-Saturday).
dddddShows a complete date (with day, month and year), formatted according to the Windows short date setting (sShortDate=). This string is defined in the international part of WIN.INI. If there is no such definition in WIN.INI then the date will be shown in standard format "mm/dd/yy".
mShows the month as a number without leading zeros (1-12). If this symbol follows an h or hh format then minutes will be shown instead of the month.
mmShows the month as a number with leading zeros (01-12). If this symbol follows an h or hh format then minutes will be shown instead of the month.
mmmShows the month as three-letter abbreviation (Jan-Dec).
mmmmShows the month with its full name (January-December).
yyShows the year as a two-digit number (00-99).
yyyyShows the year as a four-digit number (1900-2040).
hShows the hour as a number without leading zeros (1-24).
hhShows the day as a number without leading zeros (01-24).
mShows minutes as a number without leading zeros (0-59). If this symbol does not follow an h or hh format then months will be shown instead of minutes.
mShows minutes as a number with leading zeros (00-59). If this symbol does not follow an h or hh format then months will be shown instead of minutes.
sShows seconds as a number without leading zeros (0-59).
ssShows seconds as a number with leading zeros (00-59).
t t t t tShows a complete time (with hours, minutes and seconds), formatted with the time delimiter according to the Windows short time setting (sTime=). A leading zero will be shown if the entry for leading zeros (iTLZero=) is set to "true" and the time is before 10:00 o'clock or 22:00 o'clock. These strings are defined in the international part of WIN.INI. If there is no such definition in WIN.INI then the date will be shown in standard format "h:mm:ss".
AM/PMUses the 12-hour format. Before 12:00 o'clock "AM" is shown. Between 12 o'clock and 24:00 o'clock "PM" is shown.
am/pmUses the 12-hour format. Before noon "am" is shown. Between noon and midnight "pm" is shown.
A/PUses the 12-hour format. Before noon "A" is shown. Between noon and midnight "P" is shown.
a/pUses the 12-hour format. Before noon "a" is shown. Between noon and midnight "p" is shown.
AMPMUses the 12-hour format. Before noon the "1159 string" (s1159=) as defined in WIN:INI is used. After noon the "2359 string" (s2359=) as defined in WIN.INI is used. It does not matter whether AMPM is written in upper or lower case because the string is used exactly as defined in WIN.INI. The standard time format is "AM/PM".
"xyz"Shows the arbitrary text xyz. This can be used to add free text to the display.
\xDisplays the character x. This can be used to show characters that would otherwise constitute a format string.

Some examples follow.

Format expressionResult
--------------------------------------------------------
d/m/yy7/12/58
d/mmmm yy7/December 58
d/mmmm7/December
mmmm-yyDecember-91
hh:mm AM/PM08:50 PM
h:mm:ss a/p8:50:35 p
h:mm20:50
h:mm:ss20:50:35
m/d/yy h:mm12/7/91 20:50
dddd, mmmm d, yyyy, h"h" m"m" s"s"
Monday, October 30, 1991, 11h 5m 31s
it must be in the same directory with the .EXE file. Windows Write (WRITE.EXE) must also be available.wsl<>[email protected]%%
=PaF<
$
&=.PK\\\\\\T\V\a\\\\\\\<\B\\(\b\\\\\$\a\\\
\E
\<[E

\\\\)\
\p\\4\\\6\\\\<[\\\(\A\T\i\\\\\\\\\<[ Helv), formatted according to the Windows short date setting (sShortDate=). This string is defined in the international


 December 13, 2017  Add comments

Leave a Reply