In this Post, we are getting date after or before the 7 days from the current date using date function.
In Our live projects we had lots of requirement for using it and then we need to make this code as soon as possible.
Method 1:-
Using Simple method we were able to make this code according to need and used it.
Start from Here: -
You have to take below code and use it directly and test in WAMP server.
We can also get date after 7 days from the current date.
Method 2:-
How to get datetime 3 days before from the current date using PHP in date("Y-m-d H:i:s");?
for getting date before 3 days from the current date in datetime format, we have to use PHP function strtotime().
For Example: -
In Our live projects we had lots of requirement for using it and then we need to make this code as soon as possible.
Method 1:-
Using Simple method we were able to make this code according to need and used it.
Start from Here: -
You have to take below code and use it directly and test in WAMP server.
Note: - According to the requirement you can also change into the code. Like how many days you required before and after current date. In the Example, We are using 7 days before and after. just you have to change into "($currdate-7)" 7 number.
We can also get date after 7 days from the current date.
Note: - For using after current date change the difference of date by changing the "($currdate+7)" 7 number to get according yourself.
Method 2:-
How to get datetime 3 days before from the current date using PHP in date("Y-m-d H:i:s");?
for getting date before 3 days from the current date in datetime format, we have to use PHP function strtotime().
For Example: -
If you still face any difficulty then feel free to contact me from the below form
0 comments:
Post a Comment