FormatString Property (PITimeFormat Object)


See Also     Example         

 

FormatString is a Read/Write property used to set the desired output format for time strings. This is similar to a Picture clause in other languages.

Syntax

object .FormatString

The object placeholder is an expression that evaluates to a PITimeFormat object.

The string may contain any combination of the following characters. The format string is not locale sensitive, but the OutputString property. will be displayed according to the LocaleIndependent property. Thus, the entries below that specify local settings display formats based on the regional settings for the thread in which the time object is created if LocaleIndependent is false.

Characters Meaning
yy, yyyy Year, 2 or 4 digits
M, MM Month, short/long number
MMM, MMMM Month, short/long name
d, dd Day, short/long number
ddd, dddd Weekday, short/long name
h, hh Hour, short/long number
m, mm Minute, short/long number
s, ss Seconds, short/long number
0 - 000000 Fraction of second, show trailing zeros
# - ###### Fraction of second, no trailing zeros
z, zz Time zone, short/long name
i[name] Interval ordinal, short form
ii[name] Interval ordinal, long form
iii[name] Interval member name, short
iiii[name] Interval member name, long
. Local decimal separator.
: Local time separator.
- Local date separator.
AP Local AM/PM symbol. Specifying AP also changes to 12 hour time display format. The default time format without AP is 24 hour time display.
\ The character following the backslash is literal.
Any other character. Itself. For instance, a "T" inserted between date and time.

Remarks

An example of a PI time format string is "dd-MMM-yy hh:mm:ss" with the LocaleIndependent property set to true. This would produce the string "05-May-05 05:05:05". If the LocaleIndependent property is set to false, the date separator and time separator will be displayed according to the user's current locale setting ("05/May/05 05:05:05").

Enabling Operational Intelligence