RE: [PHP] bumping up hour by one
| From: | John Holmes | Date: | Thu, 02 May 2002 04:39:09 +0000 |
| Subject: | RE: [PHP] bumping up hour by one | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-95637@lists.php.net to get a copy of this message | ||
Doesn't matter, PHP will juggle the type and make it a number. What do
you get for results, these look like they should work. Are you getting
errors or are you getting odd results?
---John Holmes...
> -----Original Message-----
> From: Tom Beidler [mailto:tom@orbittechservices.com]
> Sent: Wednesday, May 01, 2002 6:06 PM
> To: php list
> Subject: [PHP] bumping up hour by one
>
> I'm having some problem with some code where I'm trying to round the
hour
> up
> to the next hour if the minutes are between 53 and 59. Here's the
> important
> part of the code so you can see what I'm trying to do.
>
> $display_time = date("H:i");
>
> // round time
> $display_timex = explode (":",$display_time) ;
>
> and then...
>
> elseif (($display_timex[1] >= 53) && ($display_timex[1] <= 59)) {
> $display_timex[0]++;
> $insert_time = $display_timex[0] . ":00";
> }
>
> I've also tried ...
>
> elseif (($display_timex[1] >= 53) && ($display_timex[1] <= 59)) {
> $display_timex[0] = $display_timex[0] + 1;
> $insert_time = $display_timex[0] . ":00";
> }
>
> Is it because display_timex[0] is not a number????
>
> Thanks,
> Tom
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php