Dt to strf
DT_TO_STRF¶
| Type Function | STRING |
| Input DTI | DT (Date and time input value) |
| MS | INT (ms input) |
| FMT | STRING (default format for output) |
| LANG | INT (default language) |
| Output | STRING (result string ) |
| DT_TO_STRF converts a DATETIME value into a formated string. At the input DTI the convertible DATETIME value appears and with the string FMT the appropriate output format is determined. The input LANG determines the language to be used (0 = LANGUAGE_DEFAULT, 1 = English and 2 = German). The language settings are made in the relevant paragraph of the global constants and can be adapted or modified. In addition to the date and time at the input of MS also milliseconds can be processed. | |
| The generated string matches the string FMT where in the string all characters '#' followed by a capital letter are replaced with the corresponding value. The following table defines the format characters |

Example:
DT_TO_STRF(DT#2008-1-1, 'Datum '#C. #F #A', 2) = '1. Januar 2008' DT_TO_STRF(DT#2008-1-1-13:43:12, '#J #M:#Q am #C. #E #A', 2) = 'Di 13:43 am 1. Jan 2008'
| #A | 4 digit year number (2008) |
|---|---|
| #B | 2-digit year number, eg (08) |
| #C | Month 1-2 digits (1,12) |
| #D | Month 2 digits (1, 12) |
| #E | Month 3 letters (Jan) |
| #F | Months written out (January) |
| #G | Day 1 or 2 digits (1, 31) |
| #H | Day 2-digit (01, 31) |
| #I | Week as a number (1 = Monday, 7 = Sunday) |
| #J | Week 2 letters (Mo) |
| #K | Week written out (Monday) |
| #L | AM or PM in American date formats |
| #M | Hour in 24 hour format 1-2 digits (0, 23) |
| #N | Hour in 24 hour format 2 digits (00, 23) |
| #O | Hours in 12 hours Format 1 - 2 digits (1, 12) |
| # P | Hour in 12 hour format 2 digits (01, 12) |
| #Q | Minutes 1-2 digits (0, 59) |
| #R | Minutes 2 digits (00, 59) |
| #S | Seconds 1-2 digits (0, 59) |
| #T | Seconds 2 digits (00, 59) |
| #U | Milliseconds 1-3 digits (0, 999) |
| #V | Milliseconds 3 digits (000, 999) |
| #W | Day 2 digits but pre-padded with blank (' a' .. '31 ') |
| #X | Month 2 digits but pre- padded with blank (' 1' .. '12 ') |