STRFTIME Function
Formats dates with custom patterns.
sql
1SELECT STRFTIME('%Y-%m-%d', 'now');
2-- Returns: 2024-03-15Format Codes
| Code | Meaning |
|---|---|
| %Y | Year (4 digits) |
| %m | Month (01-12) |
| %d | Day (01-31) |
| %H | Hour (00-23) |
| %M | Minute |
| %S | Second |
Example
sql
1SELECT STRFTIME('%d/%m/%Y', '2024-03-15');
2-- Returns: 15/03/2024