Mysql Time Requests

I have a column that uses a timestamp. My question is: I'm a little confused about how to make requests against him, as I would say

Where is $ time after X date

Are requests requested at local time or CUT?

When I just try to do where and the date / time of publication, I get an error message due to a space, and if I quote it, I think it takes it as a string: /

What format do I use for dates in WHERE clauss!?!?

+3
source share
2 answers

You can use regular logical comparisons, for example:

SELECT * FROM table WHERE date >= '2010-01-31'
SELECT * FROM table WHERE date >= '2010-01-31 12:01:01'

, , , "SELECT CURTIME()" . , , - ..., .

:

http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html

+9

, TIMESTAMP ( Unix), 'YYYY-MM-DD HH:MM:SS' (), YYYYMMDDHHMMSS

, spearators, ( ), ccount

+4

Source: https://habr.com/ru/post/1763731/


All Articles