A way to not display minutes if they are zeros?
Moderator: General Moderators
-
jaybuckner
- Forum Newbie
- Posts: 1
- Joined: Wed Sep 09, 2009 9:30 am
A way to not display minutes if they are zeros?
Is there a way to not show the minutes when they are zeros? For example, 3:00 pm should display as 3 pm; however, 3:01 pm should display the same as 3:01 pm. Let it be know that I'm not a coder, but I'm attempting to modify a calendar so that the double zeros don't display. Thanks for any help you can offer.
- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
Re: A way to not display minutes if they are zeros?
Code: Select all
if($minutes != '00') echo $minutes; //if $minutes is a string
if(($minutes > 0) echo $minutes; //if $minutes is an integer
Last edited by jayshields on Wed Sep 09, 2009 10:30 am, edited 1 time in total.