
Show content when date is between dates 25th and 15th
- or -
Post a project like this3030
$$
- Posted:
- Proposals: 7
- Remote
- #1446064
- Awarded
⭐⭐⭐⭐⭐ Python | Wordpress | Shopify | AI | Data Science | React | PHP | Flutter ⭐⭐⭐⭐⭐

Web Application Developer(PHP, Wordpress, Laravel,Yii,Angularjs and Node js),Ecommerce Application Developer( magento)
eCommerce Development, Mobile App Development, Full Stack Development, Custom Product designer, Web Development, a Complete web Solutions

106476369624815176204648545012602973011050475





Description
Experience Level: Intermediate
General information for the website: Wordpress-website
Description of requirements/features: I need a php-code to echo content when the date is between the dates 25th and 15th. Instead of having to add the dates manually for each upcoming period, i'd like the php code to automatically check for the period instead.
The code I use currently, that I have to change manually each period, looks like this:
---php
$now = new DateTime();
$startdate = new DateTime("2017-01-25");
$enddate = new DateTime("2017-02-15");
if($startdate <= $now && $now <= $enddate) {
echo 'Yes';
}else{
echo "No";
}
---
For example:
If today would be the 24th of the month, that is not between the 25th and 15th - so the content will be the else-line "no".
If today would be the 12th of the month - the content would echo the first line "yes"
Extra notes:
Description of requirements/features: I need a php-code to echo content when the date is between the dates 25th and 15th. Instead of having to add the dates manually for each upcoming period, i'd like the php code to automatically check for the period instead.
The code I use currently, that I have to change manually each period, looks like this:
---php
$now = new DateTime();
$startdate = new DateTime("2017-01-25");
$enddate = new DateTime("2017-02-15");
if($startdate <= $now && $now <= $enddate) {
echo 'Yes';
}else{
echo "No";
}
---
For example:
If today would be the 24th of the month, that is not between the 25th and 15th - so the content will be the else-line "no".
If today would be the 12th of the month - the content would echo the first line "yes"
Extra notes:
My Josephine P.
100% (24)Projects Completed
17
Freelancers worked with
14
Projects awarded
16%
Last project
27 Jun 2018
Sweden
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
Hello,
I have reviewed the original information and sent you a proposal - do I need to submit a new proposal? I'm getting notifications that you have changed the description.
313170
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies