# Date/Time Format String Specifiers and Modifiers

LabWindows/CVI date/time format strings support the same format specifiers as strftime, with the %nf and @ extensions. The @ extension is valid only for the relative date/time format.

## Absolute Date/Time Specifiers and Modifier

The following list describes the absolute date/time format string specifiers:

- %H—Hour in 24-hour format, also known as military time. Valid values are 00–23.
- %I—Hour in 12-hour format. Valid values are 01–12.
- %M—Minute, as an integer. Valid values are 00–59.
- %S—Second, as an integer. Valid values are 00–59.
- %nf—The fractional part of the seconds, rounded to n digits of precision, where n is an integer between 1 and 20. If you do not specify a value for n, LabWindows/CVI uses a default precision, which depends on how you use the format string. If you are formatting a graph or strip chart axis, LabWindows/CVI uses the precision specified for the axis. If you are using FormatDateTimeString, LabWindows/CVI uses 3 as the default number of digits.
- %p—Current locale AM/PM indicator for a 12-hour clock.
- %b—Abbreviated month name.
- %B—Full month name.
- %m—Month, as an integer. Valid values are 01–12.
- %d—Day of the month, as an integer. Valid values depend on the month and year and range from 01 to 31.
- %j—Day of the year, as an integer. Valid values are 001–366.
- %a—Abbreviated weekday name.
- %A—Full weekday name.
- %w—Weekday, as an integer. Valid values are 0–6, where Sunday is 0.
- %U—Week of the year, as an integer, where Sunday is considered the first day of the week. Valid values are 00-53.
- %W—Week of the year, as an integer, where Monday is considered the first day of the week. Valid values are 00-53.
- %Y—Year with century, as an integer.
- %y—Year without century, as an integer. Valid values are 00–99.
- %x—Date representation for the current locale.
- %X—Time representation for the current locale.
- %c—Date and time representation for the current locale.
- %z, %Z—Time zone name or time zone abbreviation.
- %%—Percent sign.

LabWindows/CVI also supports the # modifier, which indicates to remove leading zeros. For example, if LabWindows/CVI displays %S as 04 for a particular data value, LabWindows/CVI displays %#S as 4 for that data value.

## Relative Date/Time Specifiers and Modifiers

The following list describes the relative date/time format string specifiers:

- %H—Number of hours since the reference point.
- %M—Number of minutes since the reference point.
- %S—Number of seconds since the reference point.
- %nf—The fractional part of the seconds since the reference point, rounded to n degrees of precision, where n is an integer between 1 and 20. If you do not specify a value for n, LabWindows/CVI uses the precision specified for the graph or strip chart axis.
- %X—Time since the reference point, in the representation of the current locale.
- %d—Number of days since the reference point.

LabWindows/CVI also supports the following modifiers:

- #—The # symbol indicates to remove any leading zeros. For example, if LabWindows/CVI displays %S as 04 for a particular data value, LabWindows/CVI displays %#S as 4 for that data value.
- @—The @ symbol indicates to restrict overflow. For example, if 70 seconds have elapsed since the reference point and you specify %S as the format string, the axis displays 70. However if you specify %@S as the format string, the axis displays 10. The seconds count starts over at 0 when the number of seconds reaches 60. The @ symbol restricts overflow for hours, minutes, and seconds only. It modifies the largest applicable time unit in the format string.