OpenUtilities Substation Help

Date and Time Format

The Windows Regional and Language Settings are used to format the time and date for printed output in a locale-sensitive manner. This produces the following results when English (U.S.) is used and the short date is set to mm/dd/yyyy and the time is set to hh:mm:ss tt:

  • Pen table DATE: 12/10/2007
  • Pen table TIME: 02:36:05 PM

If you want to customize the date or time format, you can assign an ANSI C function strftime-compatible format string to any of the following variables.


Some of the more common substitution codes are listed below. With these formatting strings, you can choose how to display the date and time. For example, you can set MS_PENTABLE_DATE_FORMAT="It is now %I:%M %p on %A, %B %d, %Y", which displays as "It is now 02:36 PM on Monday, December 10, 2007".

%a Abbreviated weekday name (such as Thu)
%A Full weekday name (such as Thursday)
%b Abbreviated month name (such as Nov)
%B Full month name (such as November)
%c Date and time representation appropriate for the locale
%d Day of the month as a integer (00-31)
%H Hour using a 24-hour clock (00-23)
%I Hour using a 12-hour clock (01-12)
%j Day of year as decimal number (001-366)
%m Month as decimal number (01-12)
%M Minutes as decimal number (00-59)
%p AM/PM indicator for the 12-hour clock
%S Seconds as decimal number (00-59)
%w Weekday as a decimal number (0-6 with Sunday as 0)
%x Date representation for current locale
%X Time representation for current locale
%y Two-digit year number (such as 99)
%Y Four-digit year number (such as 1999)