Home » SQLite datetime

SQLite datetime Function

The SQLite datetime function is used to retrieve date and time in different format. The result format of datetime function is ‘YYYY-MM-DD HH:MM:SS’.

Syntax:

Example1: Retrieve current date and time:

Output:

SQLite Datetime function 1

Example2: Add/ subtract years to current date and time:

Output:

SQLite Datetime function 2 SQLite Datetime function 3

Example3: Add/ subtract days to current date and time:

Output:

SQLite Datetime function 4 SQLite Datetime function 5 SQLite Datetime function 6

Example4: Add/ subtract hours to current date and time:

Output:

SQLite Datetime function 7 SQLite Datetime function 8 SQLite Datetime function 9

Example5: Add/ subtract minutes to current date and time:

Output:

SQLite Datetime function 10 SQLite Datetime function 11


Next TopicSQLite Juliandday

You may also like