Jump to content

[SOLVED] effective due date? timestamp? FATAL error.


kr3m3r

Recommended Posts

Hi, I'm building a library with php, and want to create a way for the return date for an item to automatically be 14 days after they are checked out.

I had hoped to use something like:

$Check_Out_Date=TIMESTAMP[(];

and then manipulate that with substrings and whatnot, until i could put it back together as 2 weeks later.  Unfortunately I'm getting a FATAL error, with this.  Any recommendations would be really appreciated.

Thanks for your time,

-Robb

Well, the book I'm using said there was a timestamp()function, but I can't seem to find more on it.

Now I'm trying to use date and the result I'm getting is:

Warning: Wrong parameter count for date() in /home/.titch/rwkremer/kr3m3r.com/Sub_Check_Out.php on line 105

from the code:

echo date();

 

I'm really just hoping to find a way to create a due date of 14 days from the date of check out.

Thanks again for the help.

-Robb

Well, the book I'm using said there was a timestamp()function, but I can't seem to find more on it.

Now I'm trying to use date and the result I'm getting is:

Warning: Wrong parameter count for date() in /home/.titch/rwkremer/kr3m3r.com/Sub_Check_Out.php on line 105

from the code:

echo date();

 

I'm really just hoping to find a way to create a due date of 14 days from the date of check out.

Thanks again for the help.

-Robb

 

Aye, the date function requires parameters, look it up on php.net.  So, you need the date + 14 days applied to a variable that can be saved?

 

Ok


$newdate = date('d') + 14 . ' ' . date('m y');
echo $newdate;

 

Hmm ,but that doesn't move it into the next month.. so I guess you could do and if on the result you get from simply adding 14 to the day number of the month? but then you'd have to index all the days in each month.. ill keep working on this for you

 

The timestamp function, that regards the unix epoch time is time();

I double posted for a reason, that reason is because this post defeats the object of the one previous

 

$newdate = date('Y-m-d', strtotime('+14 day'));
echo $newdate;

 

Turns out there's an easier solution ;)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.