This topic is locked

Working with calculated dates in PhP

3/17/2018 8:54:29 AM
PHPRunner General questions
G
gagsoft author

I have this code in a before record event to enter a future date column Expdate.

$values['expdate']=date('Y-m-d', strtotime('+7 days'));

I get the following error

<<< Record was NOT added >>>

Column 'Expdate' specified twice
Any pointers would be appreciated
Thanks

Peter G

HJB 3/17/2018

Date plus 30 days
echo date("Y-m-d", strtotime('+30 days'));
excerpt out of https://xlinesoft.com/blog/2014/11/12/datetime-handling-in-web-applications/

admin 3/19/2018

I think you should try the following:

$values['Expdate']=date('Y-m-d', strtotime('+7 days'));


Column names are case-sensitive.