Path: utzoo!attcan!utgpu!watmath!julian!uwovax!13001_6035 From: 13001_6035@uwovax.uwo.ca Newsgroups: comp.binaries.ibm.pc.d Subject: Re: Good date programs Message-ID: <2219@uwovax.uwo.ca> Date: 18 May 89 10:40:32 GMT References: <1163@marlin.NOSC.MIL> Lines: 58 Organisation: University of Western Ontario, Canada In article <1163@marlin.NOSC.MIL>, jbjones@marlin.NOSC.MIL (John B. Jones) writes: > I need a nice date program which I can use at the command line, which > won't expect a return or prompt me for a change, and which displays the > date and the day of the week. The output will probably look like this: > > May 16, 1989 Tuesday What follows is what I think is a more efficient way of displaying the time and the date under DOS 3.3. Somehow I think this is a more elegant approach than piping DATE and TIME into FIND. -----SHOWDT.BAT BEGINS-----CUT HERE----- @echo off set oldprompt=%prompt% prompt Date: $d$_Time: $t. echo on @echo off echo. prompt %oldprompt% set oldprompt= -----SHOWDT.BAT ENDS-----CUT HERE----- -----NOTE THAT THE 5TH LINE IS INTENTIONALLY LEFT BLANK. For those new to DOS 3.3, I will explain how this works. 1. @echo off Standard ECHO OFF command, but when in a batch file a command is preceded by an '@' then it is not echoed. This avoids the ugly C:\>ECHO OFF at the beginning of the batch-file. 2. set oldprompt=%prompt% Save the old environment PROMPT variable, so we get the same DOS prompt when we are done. 3. prompt Date: $d$_Time: $t. This sets the DOS prompt (normally something like "C:\>") to show up "Date: " followed by a return ($_), followed by "Time: