JSI Tip 3647. DDATE freeware logs messages with custom date / time format.

Jerold Schulman

May 1, 2001

2 Min Read
ITPro Today logo in a gray background | ITPro Today


Download DDATE.ZIP.

I have reproduced the DDATE.TXT file:

 =========================================================================
========================================================================= There are a ton of utilities for displaying the date and time, and even a number designed to use with log files.  However, I couldn't find anything that supported a "user-defined" date and time format. I use dDATE to log status information when my web servers run events each night. ------------------------------------------------------------------------------ dDate v1.0 - Display Current Date & Time Copyright (c) 2001 WebGeek, Inc. Usage: ddate [options] [text] Options:   /? or /h              Display help.   /dxxxx                Date format.   /d-                   No date display.   /e                    English.   /g                    GMT time.   /txxxx                Time format.   /t-                   No time display. ------------------------------------------------------------------------------ The default date and time formats are:   yyyy-MM-dd   HH:mm:ss Day and Month names are given using the default language.  You can use the "/e" option to force English names. Date Format Strings:   d         Day of month as digits with no leading zero for single-digit days.   dd        Day of month as digits with leading zero for single-digit days.   ddd       Day of week as a three-letter abbreviation.   dddd      Day of week as its full name.   M         Month as digits with no leading zero for single-digit months.   MM        Month as digits with leading zero for single-digit months.   MMM       Month as a three-letter abbreviation.   MMMM      Month as its full name.   y         Year as last two digits, but with no leading zero for years less             than 10.   yy        Year as last two digits, but with leading zero for years less than             10.   yyyy      Year represented by full four digits. Time Format Strings:      h         Hours with no leading zero for single-digit hours; 12-hour clock.   hh        Hours with leading zero for single-digit hours; 12-hour clock.   H         Hours with no leading zero for single-digit hours; 24-hour clock.   HH        Hours with leading zero for single-digit hours; 24-hour clock.   m         Minutes with no leading zero for single-digit minutes.   mm        Minutes with leading zero for single-digit minutes.   s         Seconds with no leading zero for single-digit seconds.   ss        Seconds with leading zero for single-digit seconds.   t         One character time-marker string, such as A or P.   tt        Multicharacter time-marker string, such as AM or PM. ------------------------------------------------------------------------------ Anything passed on the command line that is not an option will be displayed to STDOUT:   ddate Reboot Server results:   [2001-04-30 11:00:41] Reboot Server You can force GMT (or System) time by using the "/g" option. ------------------------------------------------------------------------------ This utility is provided as FREEWARE.  You are free to use it on one or more computers without a fee. The latest version of this utility can be downloaded from the CMD Tools web site at  --Dave Navarro, Jr.   [email protected]



Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like