The unix_timestamp function in MySQL has two types for calling.
1 No parameter call: unix_timestamp ()
Returned value: the difference in the number of seconds from '2017-01-01 00:00:00 'to the current time
Example: Select unix_timestamp () => 1339123415
2 parameter calls: unix_timestamp (Date)
Here, date can be a date string, A datetime string, a timestamp, or a number in the yymmdd or yyymmdd format of the local time
Returned value: the difference between '2017-01-01 00:00:00 'and the specified time in seconds
Example:
Date string format: (date type)
Select unix_timestamp ('2017-06-08 ') => 2012
Select unix_timestamp (current_date () = & gt; 1339084800
Note: The returned value of current_date () is a date string format.
The returned results are the same in the following formats:
Select unix_timestamp ('20140901 ');
Select unix_timestamp ('2017-6-8 ');
Select unix_timestamp ('2017-06-08 ');
Results: 1339084800
Datetime string format: (combination type of date and time)
Select unix_timestamp ('2017-06-08 10:48:55 ') => 2012
Select unix_timestamp (now () = & gt; 1339123415
Note: The Return Value of now () is a datetime string format.