Jump to content

strtotime() function


holy24

Recommended Posts

Hi, I am trying to use the strtotime() function, but I am not sure how to get the result if I include a date manually. Example 1: If I get the default date today (03/12/2012), the below code will add 1 day so the output will be 04/12/2012 which is correct. date("d-m-Y",strtotime("+1 day")); Example 2: If user entered a date (eg. 01/12/2012), i tried below code it will give me 02/01/1970. The result should be 02/12/2012. date("d-m-Y",strtotime("+1 day", "01/12/2012")); Thanks in advance for the help.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...