Page 2 of 2

Posted: Wed Oct 26, 2005 1:37 pm
by Burrito
damn it!

I just read more carefully

doh!

this is how it needs to be (to show hours)

Code: Select all

$now = date("m/d/Y g:i a");
echo date("m/d/Y g:i a",strtotime($now." +5 weeks 2 hours"));

Posted: Wed Oct 26, 2005 1:43 pm
by Luke
same thing it keeps giving me 10/26/05 3:09 and 11/23/05 1:43 (this is supposed to be 4 weeks and two hours, because I changed the amount of weeks)

Posted: Wed Oct 26, 2005 1:43 pm
by Luke
Burrito wrote:damn it!

I just read more carefully

doh!

this is how it needs to be (to show hours)

Code: Select all

$now = date("m/d/Y g:i a");
echo date("m/d/Y g:i a",strtotime($now." +5 weeks 2 hours"));
that's what I have

Posted: Wed Oct 26, 2005 1:47 pm
by Luke
I thought it was working... but here's what it gives me... I put in 11/22/05 10:00 as my start date, and it gave me 11/23/05 1:49 as an end date... like 4 weeks and 11 minutes off.

Posted: Wed Oct 26, 2005 1:52 pm
by Luke
Here's the code:

Code: Select all

$this->startdate = date("n/j/y g:i", $this->start);
		if($this->sku == "SE08"){
			$this->enddate = date("n/j/y g:i",strtotime($startdate." +5 weeks 3 hours"));
		}
		else{
			$this->enddate = date("n/j/y g:i",strtotime($startdate." +4 weeks 2 hours"));
		}
        echo "$this->startdate and $this->enddate";

Posted: Wed Oct 26, 2005 2:10 pm
by Luke
Works now... I am seriously retarded.

Posted: Wed Oct 26, 2005 11:56 pm
by AGISB

Code: Select all

$timestamp + (60 * 60 * 24 * 7 * 5 + (60 * 60 * 2))
wouldn't that just do it ?