I have a question on calculating times.
I have a simple table filled with 3 columns. column 1 will be passed by NOW() in the VALUE. The second column should be the NOW() timestamp plus 14 days. I never used timefunctions before, so I do have some understanding problems.
So is it possible when I have:
$copy = "INSERT INTO table (a, b, c) VALUES (NOW(), $var_for_b, $var_for_c)";
to use for
$var_for_b
easily
NOW()+14d
or do I have to set a variable with a time/date function?
in case of using a variable what can I do there?
$in_14_days =mktime(+14d)
and my third column should simply be the difference between the NOW() and the NOW(+14d).
I’m sorry for this question but there are so many timefunctions that I do not guess the differences between them.
You can do
now() + interval 14 dayto set a date in the future.so your insert statement becomes: