I get ‚null‘
You already said that earlier, the question is
Taifun
The format of your Datum should be yyyy-mm-dd
Taifun
When my wife opens a box of pasta, she dumps it out onto a sheet of paper to check for creepy crawlers.
Only after verifying it is good, she pours it into the pot.
(She doesn't throw the box into the pot, as far as I can tell)
A good coder does the same with Web and data base output.
Use a global variable for the sheet of paper.
Here are some good tests:
-
Is a list?
-
Length of list greater than (0/1/2/...)?
-
Length of list of list item n?
To get leading zeros for 1 digit months and days you could use this procedure
Taifun
Ai2 by default renders lists and dictionaries as JSON text when you ask to output them in human readable form.
JSON gives you hints as to the original structure of the list or dictionary.
The nested [ marks tell you if it was a list. Nested [[ tells you it was a list of lists. Quote marks versus numbers without quote marks tell you if it was a number or text. { marks tell you it was a dictionary.
So if you return raw web or database returns into a Label.Text or the Do It of a global variable (better), you will have the mental tools needed to read and decipher the internal structure of what was returned.
- a sharp eye, willing and able to spot what doesn't belong
- imagination to visualize the flow of data over time and space
- a mental catalog of the different ways data can assemble into data structures
- a vocabulary to describe things and their attributes
- numeracy, to distinguish between one and many
- a firm grasp of Murphy's Law, and willingness to address the possibility that things can go wrong
- courage to read code all the way through
- knowing when to go back and read the docs
(What did I miss?)
Trace the output from SQLite using Do It, block by block, working from top down, right to left.
Keep going until your blocks look like a pin cushion.
Firstly, mind your language...
Secondly, you appear to have left out the listFixer block when returning table data from sqlite db.
Thirdly, did you store your millis number in a TEXT field as indicated in my example, and as forewarned.
Why are you still storing the date as numbers?
EDIT: small correction: yyyy-MM-dd is the correct one, because MM is months and mm is minutes
Taifun
yes, here is my extension for your need- [Paid] Online Date Pro Extension | Unhackable Date | 100% Uptime | Create Subscription App | Show Live CountdownDays, Weeks Ago Pattern |
Please excuse the words „the hell“ and „Jesus Christ“.
I was very aroused yesterday.
Listfixer did nothing to help.
Now I will store it in a Textfield.
Thank You very much for your help and please excuse.
Emanuel
I added a link to the official Sqlite documentation page yesterday.
It's interesting reading, especially the section on how Sqlite handles data types for dates compared to other SQL engines
If you store a number in a Sqlite date field , it's interpreted as seconds from 1970.
That is 1000 times off from AI2 clock milliseconds.
S O L U T I O N
- TIMAI2 was right. Dates should be converted to Milliseconds.
- Store the Value in a Textfield (important!)
- You can select the value then, from your DB use it like an integer and make calculations with it.
- You don‘t have to buy any extensions from ‚whoever‘.
The most interesting methods can be found at the CLOCK-Widget. - The ListFixer sounds good, but did not work in my case. I cleaned the things, I selected from the DB by myself. (some experts will shout now
- !!! Don‘t throw away your nerves and use strong language !!! It doesn‘t help anything.
- keep cool and good luck!