DateEcho
Purpose
DateEcho echoes (sic!) the current date or time or both to STDOut. As you might know, STDOut can be redirected to a file
via the > or >> operator, like MyTool.exe >> file.txt.
Because of this, the results of DateEcho can be either used to display date/time in a command prompt window or insert
into/redirected to a file.
Download
DateEcho
Installation
None. Download the ZIP file, extract the included executable and run it.
Please note: this is a console application. You should run it from a command prompt.
Use case(s)
-
-
On screen: provide visual feedback in between long enduring tasks. For example backup jobs.
-
In a file: time-stamp log file entries.
Syntax
DateEcho /<Date|Time|DateTime|Mask>=<Format>
Parameters:
-
/d = date only
-
/t = time only
-
/dt = date and time
-
/m = custom format
Format (d|dt)
-
l = long date/time format as defined on the machine's regional settings
-
s = short date/time format as defined on the machine's regional settings
Please note that Format is only usefull for dates. It can be omitted for the parameter /t.
Custom format
-
yyyy - 4-digit year
-
yy - 2-digit year (with leading zero)
-
mm - 2-digit month (with leading zero)
-
dd - 2-digit day (with leading zero)
-
wd - 1-digit day of week (0=Sunday ... 6=Saturday)
-
hh - 2 digit hour, 24 h format (with leading zero)
-
nn - 2 digit minute (with leading zero)
-
ss - 2 digit second (with leading zero)
-
ms - 3 digit millisecond (with leading zero)
Examples
DateEcho /d=l
Dienstag, 31. Juli 2012
DateEcho /d=s
31.07.2012
DateEcho /t
19:30:12
DateEcho /dt=s
31.07.2012, 19:30:12
DateEcho /m=backup_yyyy-mm-wd_hh-ms
backup_2017-10-01_16-149
Source code
The PowerBASIC source code is available at Github
Known issues / limitations
Version
-
2.0.0 - October 2017
-
New command line parameter: /m.
-
1.0.3 - May 2017
-
Compiler glitch workaround.
-
1.0.1 - February 2017
-
No functional change, source code reformatted and uploaded to Github.
-
-
1.0 - August 2012