![]() Sqlite> SELECT strftime('%s','now') - strftime('%s',' 02:34:56') įollowing command computes the date of the first Tuesday in October for the current year. Sqlite> SELECT julianday('now') - julianday('') įollowing command computes the number of seconds since a particular moment in 2004. Sqlite> SELECT datetime(1092941466, 'unixepoch', 'localtime') įollowing command computes the current UNIX timestamp.įollowing command computes the number of days since the signing of the US Declaration of Independence. Sqlite> SELECT datetime(1092941466, 'unixepoch') įollowing command computes the date and time for a given UNIX timestamp 1092941466 and compensate for your local timezone. Sqlite> SELECT date('now','start of month','+1 month','-1 day') įollowing command computes the date and time for a given UNIX timestamp 1092941466. 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |