> -Original Message-
> From: sono...@fannullone.us [mailto:sono...@fannullone.us]
> Sent: Thursday, August 20, 2009 3:53 PM
> To: Jonathan Tapicer; PHP General List
> Subject: Re: [PHP] Displaying 2 digit minutes/seconds
>
>
> On Aug 20, 2009, at 2:34 PM
On Aug 20, 2009, at 2:34 PM, Jonathan Tapicer wrote:
You can use sprintf or str_pad to fill in with zeros, with sprintf
you can do this:
echo sprintf('%02d', 5);
Thanks, Jonathan! I learned two new functions today! Both work
great but I think I like sprintf for this application better
On Aug 20, 2009, at 2:38 PM, Ashley Sheridan wrote:
What's wrong with using the date() function? You can have it output
any
sort of format you wish. So, getting a 2 digit time in
hours:minutes:seconds you would put:
date("H:i:s");
Thanks, Ash. I had tried that before but I couldn't find
On Thu, 2009-08-20 at 14:27 -0700, sono...@fannullone.us wrote:
> Hi all,
>
> I'm using this code to display the current time for our location on
> our website:
>
>date_default_timezone_set('America/Los_Angeles');
> $theTimeIs = getdate(time());
> $theHour =
You can use sprintf or str_pad to fill in with zeros, with sprintf you
can do this:
echo sprintf('%02d', 5);
That will print the string "05".
Jonathan
On Thu, Aug 20, 2009 at 6:27 PM, wrote:
> Hi all,
>
> I'm using this code to display the current time for our location on
> our website:
Hi all,
I'm using this code to display the current time for our location on
our website:
$theMinute = $theTimeIs['minutes']; // make minutes
under 10 show two digits
$theSecond = $theTimeIs['seconds'];
if($theHour > 12){
$theHour = $theHour - 1
6 matches
Mail list logo