This topic is locked

Trying to get a future date to insert

9/18/2008 12:30:59 PM
PHPRunner General questions
S
swanside author

Hi.
WHen the user ticks Invoice_Printed, I can insert the current date in the Invoice_Printed_Date field, but I also want to put a date in the Payment_Due_Date field which is 30 days after the invoice is printed, I have tried this, but I get errors, ANy ideas please?
Thanks

if ($values["Invoice_Printed"])

$values["Payment_Due_date"] = ("Y-m-d",strtotime("+30 day"));
J
Jane 9/19/2008

Hi,
I suppose you have missed date() functio nin your code:

if ($values["Invoice_Printed"])

$values["Payment_Due_date"] = date("Y-m-d",strtotime("+30 day"));

S
swanside author 9/19/2008

Hi,

I suppose you have missed date() functio nin your code:


Doh.
Thanks Jane