Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to format time

Posted on 2010-09-14
3
Medium Priority
?
263 Views
Last Modified: 2012-05-10
$time = "08:00:00";  (Hour:Minute:Seconds)

How could I get rid of the two zeroes for second?
0
Comment
Question by:lericson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 9

Expert Comment

by:Sander Stad
ID: 33673117
0
 
LVL 31

Expert Comment

by:Marco Gasi
ID: 33673192
See if this makes sense for you:

$time ="08:00:00";
$mytime = str_replace(":","",$time);
echo date("h:m", $mytime);

Best
0
 
LVL 31

Accepted Solution

by:
Marco Gasi earned 2000 total points
ID: 33679399
Sorry for mistake, this is correct:

echo date('h:i', strtotime("08:00:00"));

Cheers
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question