Skip
Arish's avatar

117. STRFTIME Function


STRFTIME Function

Formats dates with custom patterns.

sql
1SELECT STRFTIME('%Y-%m-%d', 'now');
2-- Returns: 2024-03-15

Format Codes

CodeMeaning
%YYear (4 digits)
%mMonth (01-12)
%dDay (01-31)
%HHour (00-23)
%MMinute
%SSecond

Example

sql
1SELECT STRFTIME('%d/%m/%Y', '2024-03-15');
2-- Returns: 15/03/2024