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

Asset Framework and PI System Explorer (PI Server 2018)

Format strings for time substitution parameters

  • Last UpdatedDec 13, 2024
  • 2 minute read

In time substitution parameters, you can include a format string that specifies the format of the time string.

Standard date and time format

Use any standard format string supported by the DateTime.ToString method, described in the MSDN article Standard Date and Time Format Strings. In the specification of the time substitution parameter, separate the substitution and the format string with a colon. For example, %TIME:d% specifies the local time in a short-date pattern.

The following table provides an abbreviated description of DateTime format strings:

Format specifier

Description

Example

d

Short date pattern

6/15/2009 (en-US)

15/06/2009 (fr-FR)

2009/06/15 (ja-JP)

D

Long date pattern

Monday, June 15, 2009 (en-US)

Montag, 15. Juni 2009 (de-DE)

f

Full date/time pattern (short time)

Monday, June 15, 2009 1:45 PM (en-US)

F

Full date/time pattern (long time)

Monday, June 15, 2009 1:45:30 PM (en-US)

g

General date/time pattern (short time)

6/15/2009 1:45 PM (en-US)

15/06/2009 13:45 (es-ES)

2009/6/15 13:45 (zh-CN)

G

General date/time pattern (long time)

6/15/2009 1:45:30 PM (en-US)

15/06/2009 13:45:30 (es-ES)

2009/6/15 13:45:30 (zh-CN)

M, m

Month/day pattern

June 15 (en-US)

O, o

Round-trip date/time pattern

2009-06-15T13:45:30.0000000-07:00

R, r

RFC1123 pattern

Mon, 15 Jun 2009 20:45:30 GMT

s

Sortable date/time pattern

2009-06-15T13:45:30

t

Short time pattern

1:45 PM (en-US)

T

Long time pattern

1:45:30 PM (en-US)

u

Universal sortable date/time pattern

2009-06-15 20:45:30Z

U

Universal full date/time pattern

Monday, June 15, 2009 8:45:30 PM (en-US)

Y, y

Year month pattern

June, 2009 (en-US)

Any other single character

Unknown specifier

Custom date and time format

You can also construct custom patterns in the date and time format string, using time specifiers described in the MSDN article Custom Date and Time Format Strings. For example, %TIME:yyyy/MM/dd HH:mm:ss.ffffff% produces output similar to 2015/03/31 09:28:03.843512.

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