Jump to content

Formatting time for display


skallsen

Recommended Posts

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
Link to comment
https://forums.phpfreaks.com/topic/8530-formatting-time-for-display/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.