Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

RtReports

Time format strings

  • Last UpdatedJan 24, 2023
  • 3 minute read

A time format string controls how a time element displays in the final report.

Note: The result string produced by these format specifiers is influenced by the Region and Language settings on your computer. Computers using different region, language, and advanced number and time settings will generate different result strings.

Time format string time specifiers

Format string specifier

Description

(:)

Time separator. In some locales, other characters may be used to represent the time separator. The time separator separates hours, minutes, and seconds when time values are formatted. The actual character used as the time separator in formatted output is determined by the system's LocaleID value.

(/)

Date separator. In some locales, other characters may be used to represent the date separator. The date separator separates the day, month, and year when date values are formatted. The actual character used as the date separator in formatted output is determined by your locale.

(%)

Used to indicate that the following character should be read as a single-letter format without regard to any trailing letters.

Also used to indicate that a single-letter format is read as a user-defined format.

AP

Uses the 12-hour clock and displays the locale appropriate AM indicator for any hour before noon; displays the locale appropriate PM indicator for any hour between noon and 11:59 P.M.

d

Displays the day as a number without a leading zero (for example, 1).

Use %d if this is the only character in your user-defined numeric format.

dd

Displays the day as a number with a leading zero (for example, 01).

ddd

Displays the day as an abbreviation (for example, Sun).

dddd

Displays the day as a full name (for example, Sunday).

M

Displays the month as a number without a leading zero (for example, January is represented as 1).

Use %M if this is the only character in your user-defined numeric format.

MM

Displays the month as a number with a leading zero (for example, 01/12/01).

MMM

Displays the month as an abbreviation (for example, Jan).

MMMM

Displays the month as a full month name (for example, January).

h

Displays the hour as a number without leading zeros. If "AP" is included in the format string, the 12-hour clock ( for example, 1:15:15 PM) is used. If not, the 24-hour clock (for example, 13:15:15) is used.

hh

Displays the hour as a number with leading zeros. If AP is included in the format string, the 12-hour clock (for example, 01:15:15 PM) is used. If not, the 24-hour clock (for example 13:15:15) is used.

H

Same functionality as h. It is recommended that h be used instead. See the note below this table.

HH

Same functionality as hh. It is recommended that hh be used instead. See the note below this table.

m

Displays the minute as a number without leading zeros (for example, 12:1:15).

Use %m if this is the only character in your user-defined numeric format.

mm

Displays the minute as a number with leading zeros (for example, 12:01:15).

s

Displays the second as a number without leading zeros (for example, 12:15:5).

Use %s if this is the only character in your user-defined numeric format.

ss

Displays the second as a number with leading zeros (for example, 12:15:05).

f

Displays fractions of seconds. For example ff displays hundredths of seconds, where as ffff displays ten-thousandths of seconds. You may use up to seven f symbols in your user-defined format.

Use %f if this is the only character in your user-defined numeric format.

t

Uses the 12-hour clock and displays an uppercase AM for any hour before noon; displays an uppercase PM for any hour between noon and 11:59 P.M. Not fully supported. See the note below this table.

tt

Same functionality as AP. It is recommended that AP be used in conjunction with h or hh instead. See the note below this table.

y

Displays the year number (0-9) without leading zeros.

Use %y if this is the only character in your user-defined numeric format.

yy

Displays the year in two-digit numeric format with a leading zero, if applicable.

yyy

Displays the year in four digit numeric format.

yyyy

Displays the year in four digit numeric format.

z

Displays the time zone offset without a leading zero (for example, -8).

Use %z if this is the only character in your user-defined numeric format.

zz

Displays the time zone offset with a leading zero (for example, -08).

zzz

Displays the full time zone offset (for example, -08:00).

0 - 000000

Fraction of second, show trailing zeros.

# - ######

Fraction of second, no trailing zeros.

Note: "H", "HH", "t" and "tt" are not valid formatters unless the ReportTimeZone appSetting in the web.config is set to "Client".

Related Links
TitleResults for “How to create a CRG?”Also Available in