skallsen Posted April 27, 2006 Share Posted April 27, 2006 I have this bit of code which displays a date and corresponding start and end times for that date.if( strlen($record['Day1Date']) != NULL) echo $record["Day1Date"].": ".[!--coloro:#FF6666--][span style=\"color:#FF6666\"][!--/coloro--]$record["Day1Start"][!--colorc--][/span][!--/colorc--].$record["Time1Start"]." -".$record["Day1End"].$record["Time1End"]."<br />";For $record["Day1Start"] I want the time to display hour/min like 4:00. Right now it displays as 04:00:00.I've read a bunch of information on formatting dates but I'm not understanding how to use it in this case. Can someone show me?TIA Quote Link to comment https://forums.phpfreaks.com/topic/8530-formatting-time-for-display/ Share on other sites More sharing options...
ober Posted April 27, 2006 Share Posted April 27, 2006 date("h:i A", strtotime($record['date_column']))Look up the date function in the manual for variations of the date formatting. Quote Link to comment https://forums.phpfreaks.com/topic/8530-formatting-time-for-display/#findComment-31297 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.