Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7457901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T13:22:53+00:00 2026-05-29T13:22:53+00:00

SQLite doesn’t have a data type for dates. I was wondering if it’s enough

  • 0

SQLite doesn’t have a data type for dates.

I was wondering if it’s enough to make string comparisons between date strings like Y-m-d H:i:s (the standard sql datetime format).

For example ...WHERE date < NOW().... would this fail in certain situations?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T13:22:54+00:00Added an answer on May 29, 2026 at 1:22 pm

    You can store dates in SQLite with the following data types:

    • TEXT as ISO8601 strings (“YYYY-MM-DD HH:MM:SS.SSS”).
    • REAL as Julian day numbers, the number of days since noon in Greenwich on November 24, 4714 B.C. according to the proleptic Gregorian calendar.
    • INTEGER as Unix Time, the number of seconds since 1970-01-01 00:00:00 UTC.

    You can then convert these fake dates using the functions listed here.

    Now, you also mentioned function NOW() and that won’t work in SQLite. That’s for MySQL. This will show you SQLite syntax to use:

    sqlite> select date('now');
    2012-02-12
    sqlite> select date('now') = date('2012-02-12');
    1
    sqlite> select date('now') = date('2012-02-11');
    0
    

    So, it is highly recommended for you to use this functions and, on the other side, make sure you don’t use NOW().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that SQLite doesn't support day name and month name. I have gone
I have a simple SQLite table called message: sequence INTEGER PRIMARY KEY type TEXT
I'm working with sqlite and qt. I understand that sqlite doesn't have native user
I have a problem with SQLite, it doesn't work when i call DataBaseHelper(who store
As I understand, SQLite doesn't have the math functions to properly implement the Haversine
I have an sqlite table with Date of Birth. I would like to execute
How can I name an SQLite database so it doesn't have the default name
I'm getting a bit confused by the behaviour of the SQL DATE data type
I am trying to create entities out of a SQLite database. SQLite doesnt have
I really like Xml for saving data, but when does sqlite/database become the better

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.