Created
July 27, 2013 07:00
-
-
Save anthonycole/6094052 to your computer and use it in GitHub Desktop.
#doesntwork
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$year = date("Y"); | |
// if the curret time is after november 31 but before the 31st of march, eot = 31st of march | |
$decemberstart = strtotime("1 December " + $year); | |
$marchend = strtotime("31 March " + $year); | |
// if the current time is after 1 april but before 31 july, eot = 31 july | |
$aprilstart = strtotime("1 April " + $year); | |
$julyend = strtotime("31 July " + $year); | |
// if the current time is after 1 august but before 31 november, eot = 31 novmeber | |
$auguststart = strtotime("1 August " + $year); | |
$decemberend = strtotime("31 November " + $year); | |
$user_ts = time(); | |
// 3 months | |
if(($user_ts >= $decemberstart) && ($user_ts <= $marchend)) { | |
$eot = $marchend; | |
} | |
if(($user_ts >= $aprilstart) && ($user_ts <= $julyend)) { | |
$eot = $julyend; | |
} | |
if(($user_ts >= $auguststart) && ($user_ts <= $decemberend)) { | |
$eot = $decemberend; | |
} | |
echo $eot; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment