SQLite Datetime Format

The page provides the common SQLite datetime format strings that you can use for the datetime functions including date(), time(), datetime(), and julianday() to format the date and time:

FormatDescription
YYYY-MM-DDThis is the standard ISO 8601 date format, where ‘YYYY’ represents the year, ‘MM’ represents the month, and ‘DD’ represents the day.
YYYY-MM-DD HH:MMA Julian Day number
YYYY-MM-DD HH:MM:SSThis date format includes both date and time, separated by a space. The time includes hours, minutes, and seconds.
YYYY-MM-DD HH:MM:SS.SSSThis date format includes both date and time, separated by a space. The time includes hours, minutes, and fractional seconds.
YYYY-MM-DDTHH:MMThis date format includes both date and time, separated by the letter T . The time includes hours and minutes.
YYYY-MM-DDTHH:MM:SSThis date format includes both date and time, separated by the letter T. The time includes hours, minutes, and seconds.
YYYY-MM-DDTHH:MM:SS.SSSThis date format includes both date and time, separated by the letter T. The time includes hours, minutes, and fractional seconds.
HH:MMRepresent a time value formatted as hours and minutes.
HH:MM:SSRepresent a time value formatted as hours, minutes, and seconds.
HH:MM:SS.SSSRepresent a time value formatted as hours, minutes, and fractional seconds.
nowRepresent the current time.
DDDDDDDDDDThis date format includes both date and time, separated by the letter T. The time includes hours and minutes.
Was this tutorial helpful ?