Tagged Posts with: unixtime

MySQL Match Dates with a UNIXTIME Field

December 19th, 2008 | Posted in MySQL
1

Here is how to grab and compare a date directly from a MySQL query if you are storing your dates as UNIXTIME. SELECT * FROM table WHERE MONTH(FROM_UNIXTIME(unixtime_fieldname)) = MONTH(CURDATE()) AND DAY(FROM_UNIXTIME(unixtime_fieldname)) = DAY(CURDATE()) AND YEAR(FROM_UNIXTIME(unixtime_fieldname)) = YEAR(CURDATE()) This particular query is looking for any records that have the same month, day and year as ...