Hamilton LaboratoriesHamilton C shell 2012User guideExternal utilities


Oregon Coast

Previous | Next

        Print the Date and Time

Usage:  dt [-nh-] [+format]

   date prints the date and time to stdout.  The default format
   shows the day of the week, the date and time of day in
   24-hour notation.  If an operand beginning with + is given,
   the format of the output is controlled by the field
   descriptors and other text in that operand.

   This command is normally stored in the file dt.exe and
   invoked with an alias so it can be used from cmd.exe without
   colliding with the internal cmd.exe date function.


   +format   When a format string is specified, each field
             descriptor is replaced with its corresponding
             value.  All other characters are copied to the
             output without change.

             Field Descriptors:

               %a   Abbreviated weekday.
               %A   Full weekday name.
               %b   Abbreviated month.
               %B   Full month.
               %c   Date and time in the format
                    mm/dd/yy hh:mm:ss.
               %C   Century as a decimal number 00 to 99.
               %d   Day of the month, 01 to 31.
               %D   Date in the format mm/dd/yy.
               %e   Day of the month as a 2-digit number
                    with leading space fill.
               %h   A synonym for %b.
               %H   Hour (24 h clock), 00 to 23.
               %I   Hour (12 h clock), 01 to 12.
               %j   Day of the year, 001 to 366.
               %m   Month, 01 to 12.
               %M   Minute, 00 to 59.
               %n   CarriageReturn/NewLine combination.
               %p   AM or PM.
               %r   Time, same as "%I:%M:%S %p".
               %s   Hundredths of seconds, 00 to 99.
               %S   Seconds, 00 to 61.
               %t   A tab character.
               %u   Weekday as a decimal number,
                    1 = Monday to 7 = Sunday.
               %U   Week of year (Sunday as the first day
                    of each week), 01 to 53.
               %V   Week of year (Monday as the first day
                    of each week), 01 to 53.
               %w   Weekday as a decimal number,
                    0 = Sunday to 6 = Saturday.
               %W   Week of year (Monday as the first day
                    of each week), 00 to 53.
               %x   Date in mm/dd/yy format.
               %X   Time in hh:mm:ss format.
               %y   Year, 00 to 99.
               %Y   Year with century.
               %Z   Timezone name or no characters if the
                    timezone cannot be determined.
               %%   Percent sign character.

   -n        Don't automatically append a Carriage Return-
             Line Feed sequence to the end of the output.
   -h        Help.
   --        End of options.

Previous | Next