PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Burrito
Spockulator
Posts: 4715 Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah
Post
by Burrito » Wed Oct 26, 2005 1:37 pm
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"));
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Wed Oct 26, 2005 1:43 pm
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)
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Wed Oct 26, 2005 1:43 pm
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
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Wed Oct 26, 2005 1:47 pm
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.
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Wed Oct 26, 2005 1:52 pm
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";
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Wed Oct 26, 2005 2:10 pm
Works now... I am seriously retarded.
AGISB
Forum Contributor
Posts: 422 Joined: Fri Jul 09, 2004 1:23 am
Post
by AGISB » Wed Oct 26, 2005 11:56 pm
Code: Select all
$timestamp + (60 * 60 * 24 * 7 * 5 + (60 * 60 * 2))
wouldn't that just do it ?