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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

12 hour time to 24 hour time

Status
Not open for further replies.

ameslee

Programmer
Feb 12, 2006
34
0
0
AU
just wondering how i would display 12 hour time to 24 hour time, in my database. I have an events table that has a start and finished time, i dont have the seconds displaying. If this isnt possible, is it possible to display am or pm within the field.

Hope i have explained it enough!

thanks!
 
Not enough information to give you a decent answer. What is the database you're using, what is the column type, where you store your date? If database is mysql and column is date (date, datetime, timestamp) you can use DATE_FORMAT() on your query to return the date in whatever form you want.
 
If you want to do it through the code:

Code:
$today10 = date("H:i");

Hope that helps.

Reality is built on a foundation of dreams.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top