Subject: Re: [PHP] subtracting time from date and time
>
> Richard Kurth wrote:
> >
> >
> >> -Original Message-
> >> From: Chris Boget [mailto:[EMAIL PROTECTED]
> >> Sent: Monday, June 18, 2007 10:55 AM
> >> To: Brad Bonkoski;
Richard Kurth wrote:
-Original Message-
From: Chris Boget [mailto:[EMAIL PROTECTED]
Sent: Monday, June 18, 2007 10:55 AM
To: Brad Bonkoski; Richard Kurth
Cc: php-general@lists.php.net
Subject: Re: [PHP] subtracting time from date and time
Something like this will get it into a time
> This works great tell you get to 8 hours ago
> it shows the correct time but it does not change
> the date to the day before. 8 hours ago should be
> 06/16/2007 11:35:00 but what it shows is 06/17/2007
> 11:35:00
Your code works for me. Though, I had to change the format of $str
slightly to
> -Original Message-
> From: Chris Boget [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 18, 2007 10:55 AM
> To: Brad Bonkoski; Richard Kurth
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] subtracting time from date and time
>
> > Something like this wi
Something like this will get it into a time stamp...and then you can do
your calculations with ease, and reformat...
Even easier:
$timestamp = strtotime( $str );
http://us2.php.net/manual/en/function.strtotime.php
$oneMinute = 60; // seconds
$oneHour= $oneMinute * 60;
$oneDay = $oneH
Something like this will get it into a time stamp...and then you can do
your calculations with ease, and reformat...
-Brad
Richard Kurth wrote:
I am trying to figure out what is the most accurate way to find the time
after I subtract 5 min,15 min, 30 min 1 hour 2 hours and 5 hours from a date
6 matches
Mail list logo