Deleting the code: time calculations

development, php Add comments

You can be (rich and healthy) or (poor and ill).

You can have (readable and laconic code) or (confusing one).

Oh no, I’ve said too much. I haven’t said enough” © REM. The following two examples do the same – so choose any ;]

echo time() + (60 * 60 * 24 * 14); //14 days from now
echo strtotime( '14 day');

Second variant also allows things like ‘-2 years‘.

Want the same in MySQL? Not a problem:

SELECT DATE_ADD( NOW(), INTERVAL 14 DAY )

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in