I am pulling the value EventDate from a table called events. At the moment is giving me a timestamp along with the date - 2012-05-29 00:00:00.
Is there anyway to trim this in PHP?
Try using MySQL's build in functions such as DATE_FORMAT() or even DATE()
SELECT
DATE_FORMAT(EventDate, '%Y-%m-%d') AS eventDate
FROM events;
SELECT
DATE(EventDate) AS eventDate
FROM events;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With