I make some website which will be similar to basic TODO List applications. For a single row I always store single date and I basicly dont need hours and seconds, date is just fine.
How I use data:
I have PHP backend which make SQL select and then create JSON from this data and give it frontend which is created in AngularJS.
What I want to do with data:
I want to compare data and visualize it with graphs. I am not sure whats the best way to store this kind of values.
Things I consider:
I would opt for MySQL Date.
Lets say we have a table called
my_table which has a
Date column named
You can actually interact with it in much the same way as you can a
my_date is the date that the item was created...
// Where it was created after 1st Jan SELECT * FROM my_table WHERE my_date > '2016-01-01' // Where it was created in Jan SELECT * FROM my_table WHERE my_date BETWEEN '2016-01-01' AND 2015-01-31 // Where it was created in the last 7 days SELECT * FROM my_table WHERE DATEDIFF(CURDATE(), my_date) <= 7