Created
March 28, 2017 07:52
-
-
Save slav123/ad2424925fcbd7e3218cc2e1f91e21da to your computer and use it in GitHub Desktop.
MySQL select records older then... in timestamp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT id, DATE_FORMAT(FROM_UNIXTIME(`time`), '%e %b %Y') AS 'date_formatted' FROM api_logs WHERE `time` < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 3 MONTH)) ORDER BY id DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment