W
W
we_rrw2022-04-12 03:32:13
SQLite
we_rrw, 2022-04-12 03:32:13

How to set the time in the database?

how to set time for DateTime to Sqlite database (year, month, day, hour, minute, second, millisecond/e.g. 2022-04-11 21:59:39.394939)

For operation:
if res - timedelta(hours=1) < datetime .now()

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kadabrov, 2022-04-12
@Kadabrov

The solution to your problem:
0) study in the documentation what types of fields Sqlite has
1) based on the knowledge gained, decide in what format the column for DateTime will be
2) study the datetime module
3) based on the knowledge gained, select the method with which you will convert data from Sqlite to datetime object
4) do greater than less than comparison

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question