SQLite and dates

Yes
What do you get? Show us your Do it result
And why are you wondering?

Taifun

Hi Taifun.
Thank you for everything.
Please take a look at the values in my last post.
morgen means tomorrow, …

Computers like numbers,
People like formatted date time values.

Who or what is reading your screen?

Look in the clock blocks for the conversion blocks.

1 Like

image

Thank You very much TIMAI2.

I realized, that the best thing to stor a date, is integer (since 1970).
So I do so and write the big numbers in my db.

Getting it back to readable form, makes me problems.
I want to add two days to the big number and transform it into a readable datum. 29.09.2025 (i.e.)

Please tell me the function, that converts the integer: 1757196000000 to 07.09.2025.

  • Convert milliseconds to Instant
  • Add days to Instant
  • Format date dd.MM.yyyy from Instant

Really? Let me respectfully disagree

This would be so simple with just a little bit sql

SELECT datetime('2025-09-07', '2 days');
Taifun

I wonder:



using this Block:

From what I see, you can replace all of this:

image

with this:

image

What do you wonder?

This happens without removing the brackets:

beside:

I wonder,
why the datepicker delivers 8.9.1970

It's time you learned to read JSON.

Search the Web for 'introduction to JSON '

The JSON was telling you that you received a table from the sql query.

Prove me wrong.

Thank you very much ABG.
Now I know a bit of JSON.
But does it change anything?
There muSt be other methods to receive the dataa from the DB.
Please give me a hint.

ciao Emanuel

@‚Taifun:

select Text, datetime(Datum, '-2 days') from Reminder where Status = 0 order by Datum

gives a null value:

And what do you get here

select Text, Datum from Reminder where Status = 0

Also provide your CREATE TABLE statement

Taifun

CREATE TABLE IF NOT EXISTS 'Reminder' ('id' INTEGER NOT NULL, 'Text' TEXT, 'vor' INTEGER, 'Status' INTEGER, 'Datum' TEXT, 'TST' TEXT, PRIMARY KEY('id'))

Taifun

I get ‚null‘

You already said that earlier, the question is

Taifun

just a text field with a date