Sqlite

Insert Current Time Matching DATETIME in SQLite3

In MySQL, you can use the <code>NOW()</code> function, but in SQLite you can't use the NOW function. A memo on how to INSERT the current time matching DATETIME in SQLite3. As an alternative function, there is <code>CURRENT_TIMESTAMP</code>.

Shou Arisaka
1 min read
Nov 9, 2025

In MySQL, you can use the NOW() function, but in SQLite you canโ€™t use the NOW function. A memo on how to INSERT the current time matching DATETIME in SQLite3.

As an alternative function, there is CURRENT_TIMESTAMP.

e.g.INSERT INTO Date (LastModifiedTime) VALUES(CURRENT_TIMESTAMP)

Reference

Inserting current date and time in SQLite database - Stack Overflow

Share this article

Shou Arisaka Nov 9, 2025

๐Ÿ”— Copy Links