You are on page 1of 1

Format Date/Time String Function Page 1 of 1

Format Date/Time String Function


Owning Palette: String Functions
Requires: Base Development System
Displays a timestamp value or a numeric value as time in the format you specify using time format codes.
The following codes are some of the most commonly used time format codes: %c displays locale-specific date/time; time-
related format codes include %X (locale-specific time), %H (hour, 24-hour clock), %I (hour, 12-hour clock), %M (minute), %S
(second), %<digit>u (fractional seconds with <digit> precision), and %p (a.m./p.m. flag); date-related format codes
include %x (locale-specific date), %y (year within century), %Y (year including century), %m (month number), %b
(abbreviated month name), %d (day of month), and %a (abbreviated weekday name).

Details

Find on the palette

time format string specifies the format of the output string. Time format codes (beginning with %) not
recognized by the function as a format code return the character literally. The default code is %c, which
corresponds to the date/time representation appropriate for the configured time zone for the computer. If time
format string is an empty string, the function uses the default.
time stamp can be a timestamp or a numeric. If numeric, this number is the time-zone-independent number of
seconds that have elapsed since 12:00 a.m., Friday, January 1, 1904, Universal Time [01-01-1904 00:00:00].
The default is the current date and time. If year is before 1904, time stamp is negative.
UTC format specifies if the output string is in Universal Time or in the configured time zone for the computer. If
TRUE, date/time string is in Universal Time. The default is FALSE.
date/time string is the formatted date/time string.

Format Date/Time String Details


Note LabVIEW returns abbreviated weekday and month names as numeric values for systems that do not
support abbreviated names, such as Chinese and Korean.

This function calculates date/time string by copying time format string and replacing each of the time format codes
with the corresponding values.
Time format codes have leading zeros as necessary to ensure a constant field width. An optional # modifier before the
format code letter removes the leading zeros from the following format codes:
%#d, %#H, %#I, %#j, %#m, %#M, %#s, %#S, %#U, %#w, %#W, %#X, %#y, %#Y

The # modifier does not modify the behavior of any other format codes.

Note The %c, %u, %x, %X, %z, and %Z format codes depend on operating system locale support. The output of
these codes is platform dependent. Interpretation of the Daylight Saving Time rule also can vary by platform.

The function interprets timestamp and numeric values as the time-zone-independent number of seconds that have elapsed
since 12:00 a.m., Friday, January 1, 1904, Universal Time [01-01-1904 00:00:00].

Submit feedback on this topic.

Visit ni.com/support for technical support.

mk:@MSITStore:C:\Program%20Files%20(x86)\National%20Instruments\LabVIEW%20... 2/27/2014

You might also like