kirkh34 Posted April 25, 2010 Share Posted April 25, 2010 i have a messaging system where i'd like to display the date and time of a message.... how can i take 0000-00-00 00:00:00 and pull from it to display the words, like sunday, april 25, 2010 6:00 pm, is there any easy way to do this? Link to comment https://forums.phpfreaks.com/topic/199719-displaying-date/ Share on other sites More sharing options...
de.monkeyz Posted April 25, 2010 Share Posted April 25, 2010 Use strtotime and strftime together: echo strftime('%A, %B %d, %Y %I:%M %P', strtotime($time)); If it doesn't output anything, it may be due to '%P', my system doesn't seem to support it, but supports '%p' which produces an uppercase 'PM'/'AM' Link to comment https://forums.phpfreaks.com/topic/199719-displaying-date/#findComment-1048241 Share on other sites More sharing options...
trevorsg Posted April 26, 2010 Share Posted April 26, 2010 You can also use the date function... echo date('l, f j, Y g:i a', strtotime($time)); Link to comment https://forums.phpfreaks.com/topic/199719-displaying-date/#findComment-1048279 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.