Moron Posted July 18, 2007 Share Posted July 18, 2007 I have PHP code pulling a date from a database: echo $RESULTYAB['TermExpires']; It's displaying the date like..... Jun 30 2008 12:00AM I want it to display only the "Jun 30, 2008" part. How do I truncate the timestamp off? By the way, only the date is entered into the database, so PHP must be adding the timestamp. Thanks! Link to comment https://forums.phpfreaks.com/topic/60594-how-do-i-remove-this-timestamp/ Share on other sites More sharing options...
pocobueno1388 Posted July 18, 2007 Share Posted July 18, 2007 Try using the date() fucntion. $date = date("F j, Y", strtotime($RESULTYAB['TermExpires'])); Link to comment https://forums.phpfreaks.com/topic/60594-how-do-i-remove-this-timestamp/#findComment-301431 Share on other sites More sharing options...
Moron Posted July 18, 2007 Author Share Posted July 18, 2007 Try using the date() fucntion. $date = date("F j, Y", strtotime($RESULTYAB['TermExpires'])); Works. Thanks!! Link to comment https://forums.phpfreaks.com/topic/60594-how-do-i-remove-this-timestamp/#findComment-301440 Share on other sites More sharing options...
trq Posted July 18, 2007 Share Posted July 18, 2007 Or better still, use mysql's DATE_FORMAT function. Link to comment https://forums.phpfreaks.com/topic/60594-how-do-i-remove-this-timestamp/#findComment-301441 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.