Jump to content

how to add a day to a determined date.


jbrill

Recommended Posts

Hey guys,

I have an entry in the database that holds the date (Y-m-d). Im simply trying to add 1 day to it.

 

example: if the date in the database is 2009-04-06 in my php code i want to add grab that date and add 1 day to it so it would be 2009-04-07.

 

how would i go about doing this?

Link to comment
https://forums.phpfreaks.com/topic/153032-how-to-add-a-day-to-a-determined-date/
Share on other sites

Slow parsed/tokenized/interpreted php code will require at least two function calls and will be 10-20 times slower than doing it in your SELECT query when you retrieve your existing date field. Why wouldn't you want to do it in your query?

ok good call. My current query is:

 

"SELECT * FROM `user_forgot_password` WHERE `hash`='".$hash."'"

 

I have a "date" field that is date stamped when the user requested their password reset. I would like to give them one day to reset their password or else it would expire. how would i do this in an SQL statement?

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.