Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Time??

Status
Not open for further replies.

buzzt

Programmer
Joined
Oct 17, 2002
Messages
171
Location
CA
I have a cloumn in my MySQL that is formatted as military time hh:mm:ss. How would I tell PHP to display simply hh:mm?

I have tried variations of the date() and mktime() functions, but can't get it right.
 
I'd use explode() ( to split the time string into an array at the colons then print the parts I need in the format I need.

Or I might use preg_replace() ( to simply replace &quot;colong digit digit <end of string>&quot; with nothing.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top