Date and Time Format Specifiers

Applies to AQTime 8.81, last modified on March 03, 2021

This topic describes format specifiers that can be used to specify the format for values displayed in the Time column of the Event View panel.

Format Specifiers

The following table lists specifiers that correspond to standard date and time formats. These formats are specified by the Regional Settings in the Windows Control Panel.

Specifier Description Example for
English (USA) Culture
c The date and time in the general format (if the value has no time part, formats date only). 4/23/2007 10:39:55 AM
ddddd The date in the short date format. 4/23/2007
dddddd The date in the long date format. Monday, April 23, 2007
t The time in the short time format. 10:39 AM
tt The time in the long time format. 10:39:55 AM

If you need to get the date-time string in a specific format, use the following specifiers to construct a custom format string:

Specifier Description
d Day of a month as a number without the leading zero.
dd Day of a month as a number with the leading zero.
ddd Day of a week as an abbreviation (Sun, Mon, Tue, etc.) The short day names depend on the active regional settings on your computer.
dddd The full name of a day of a week (e.g. Sunday, Monday, Tuesday). The day names depend on the active regional settings on your computer.
m Month as an integer number without the leading zero.
mm Month as an integer number with the leading zero.
mmm Month as an abbreviation (e.g. Jan, Feb, Mar). The short month names depend on the active regional settings on your computer.
mmmm The full month name (January, February, March, etc.) The month names depend on the active regional settings on your computer.
yy Displays the year using the two digit year format.
yyyy Displays the year using the four digits year format.
h Hour without the leading zero (0-23).
hh Hour with the leading zero (00-23).
n Minute without the leading zero (0-59).
nn Minute with the leading zero (00-59).
s Second without the leading zero (0-59).
ss Second with the leading zero (00-59).
z Millisecond without the leading zero (0-999).
zzz Millisecond with the leading zero(s) (000-999).
am/pm Uses the 12-hour am/pm format for the time (Displays am for the time that is before the noon. Displays pm for the time that is after the noon).
a/p Similar to the am/pm specifier, but uses a and p instead of am and pm.

Note:

The am/pm, a/p and ampm specifies have effect only if the formatting string contains either h or hh specifiers and they are located somewhere before the am/pm, a/m or ampm specifiers.
"nnn" or 'nnn' Inserts characters enclosed in single or double quotes into the resulting string. You can use this to add characters used as specifiers (such as d or m) into the string.
Any other characters do not affect formatting and are inserted in the formatted string as they are.
Examples

Below you can find examples of custom format strings and the corresponding formatted date-time strings.

Format String Result Notes
dddd, mmmm dd, yyyy hh:nn:ss AMPM Monday, April 23, 2007 10:39:55 AM Full date/time format (with long time)
ddd, dd mmmm yyyy hh:nn:ss "GMT" Mon, 23 April 2007 10:39:55 GMT RFC1123 format
yyyy-mm-dd"T"hh:nn:ss AMPM 2007-04-23T10:39:55 AM ISO 8601 format
hh:nn:ss 10:39:55  

See Also

Event View Panel Settings

Highlight search results