I have a form where user have to enter how many days example user enter for 2 days and it will deduct 2 days back.the result will looks like this
Current Date: 2012-02-10
Last date: 2012-02-08
the time will be set every 11:59pm for each duration.because from this calculation i have to find the data from sql that match with the duration time…
Current Date: 2012-02-10
Last date: 2012-02-08
List data xyz from the date is 30 times
How can I do this in PHP?
You can use something like
echo date("Y-m-d 23:59:59",strtotime("-2 days"));Just make that “2” a variable from what the user types in and make sure they use a integer. Not sure if thats what you are looking for or a different question hard to tell.