

Following command computes the current date.įollowing command computes the last day of the current month. Let's try various examples now using SQLite prompt. You can use the following substitutions to format your date and time. SQLite provides a very handy function strftime() to format any date and time. Modifiers are applied from the left to right.įollowing modifers are available in SQLite − The time string can be followed by zero or more modifiers that will alter date and/or time returned by any of the above five functions. You can use the "T" as a literal character separating the date and the time. Time StringsĪ time string can be in any of the following formats − Sr.No. Following section will give you detail on different types of time strings and modifiers.

The strftime() function also takes a format string as its first argument. The time string is followed by zero or more modifiers. This returns the date formatted according to the format string specified as the first argument formatted as per formatters explained below.Īll the above five date and time functions take a time string as an argument. This returns the number of days since noon in Greenwich on NovemB.C.

This returns the date in this format: YYYY-MM-DD SQLite supports five date and time functions as follows − Sr.No.
