Edit codes for time data

You can use several edit codes to format time data.

In the following table, x represents the character to be used as a delimiter between time values. You can choose any special character for this delimiter, including blank, but not letters or numbers.

Table 1. Time edit codes
Edit code Format Notes
TTSx HHxMMxSS 24-hour clock, including seconds
TTCx HHxMMxSS 12-hour clock, including seconds
TTAx HHxMM Abbreviated (no seconds)
TTAN HHMM Abbreviated (no seconds, no delimiter)
TTUx HHxMM AM HHxMM PM USA format
TTL Locally defined See your administrator for format information

Default time format

The default time edit code, TT, displays time in the format specified at the database requester. You can change the default time edit code by setting the DSQDC_EC_TIME global variable.

Time edit code examples

The examples in the following table show how the time 1:25:10 PM is formatted with various time edit codes.

Table 2. Examples of formatting with time edit codes
Edit code Format Notes
TTS. 13.25.10 ISO, European formats
TTS: 13:25:10 JIS format
TTU: 01:25 PM USA format
TTS, 13,25,10 Hours, minutes, and seconds (24-hour) with a comma (,) delimiter
TTC: 01:25:10 Hours, minutes, and seconds (12-hour) with a colon (:) delimiter
TTA. 13.25 Hours and minutes (24-hour) with a period (.) delimiter
TTA, 13,25 Hours and minutes (24-hour) with a comma (,) delimiter
TTAN 1325 Hours and minutes (24-hour) with no delimiter