How to Use Dates in SQLite with Python



How to Use Dates in SQLite with Python

How to Use Dates in SQLite with Python

SQLite databases don’t have a date datatype for columns. How does that work? This is a common question among developers and one that I’m going to answer for you today. In this episode we’re going to look at how to get dates in and out of either text or integer fields in SQLite, using Insert and Select statements along with some neat date functions like (new) unixepoch that SQLite provides for this purpose. We’ll insert dates and dates with times, and then select these from our tables for display.

There are additional formats and ways to store dates in SQLite, so check those out:
https://www.sqlite.org/lang_datefunc.html

Join me on Patreon!
https://www.patreon.com/mackenziedataengineering

Want the code from this video?
http://mackenziemackenzie.com/downloads

For developers looking for a new role, check out and sign up:
https://www.toptal.com/qKaO2b/worlds-top-talent

Needing to hire technical resources for your project? Get the best:
https://www.toptal.com/qKaO2b/worlds-top-talent

Contact form you can find at http://www.mackenziemackenzie.com/

Follow me on social media:
https://www.facebook.com/mackenziedataanalytics
https://twitter.com/seamacke
https://www.instagram.com/seamacke/
https://www.reddit.com/user/seamacke
https://www.linkedin.com/in/psmackenzie/

Get Microsoft Office including Access:
https://click.linksynergy.com/fs-bin/click?id=BdGJecFFM8A&offerid=1160033.10004289&type=3&subid=0

Got a YouTube Channel? I use TubeBuddy, it is awesome. Give it a try:
https://www.tubebuddy.com/seanmackenziedataengineering

#python #sqlite #dataengineering