The format is a string using the following symbols:
Symbol
Description
HH
Two-digit hours
NN
Two-digit minutes
SS.SSSSSS
Seconds and fractions of a second, up to six decimal places. Not all platforms support timestamps to a precision of six places.
AA
A.M. or P.M. (12 hour clock)—omit AA and PP for 24 hour time
PP
PM if needed (12 hour clock)—omit AA and PP for 24 hour time
Each symbol is substituted with the appropriate data for the time that is being formatted.
For symbols that represent numeric data, you can control zero-padding with the case of the symbols:
Type the symbol in same-case (such as NN or nn) to allow zero padding. For example, hh:nn:ss.sss could produce 02:34:56.123.
Type the symbol in mixed case (such as Nn) to suppress zero padding. For example, Hh:nn:ss.sss could produce 2:34:56.123.
If the first two digits of the fractional seconds are mixed case (such as Ss or sSssss) then trailing zeros are removed. For
example, hh:nn:ss.Sss could produce 12:34:56.1.