RSS

convert year or month into days, PHP

18 Nov

$lastdate=Authlite::instance()->get_user()->define_dat;

$currentDate = date(‘Y-m-d H:i:s’);

$ct = strtotime($currentDate);
$ct2 = strtotime(‘0 days’, $ct);
echo $ccurrentDate = date(‘r’, $ct2) . PHP_EOL;

$dateString = $lastdate;
$t = strtotime($dateString);
$t2 = strtotime(‘+365 days’, $t);
$endDate = date(‘r’, $t2) . PHP_EOL;
echo “Package will be exired on : “. date(‘r’, $t2) . PHP_EOL;

if($endDate >= $ccurrentDate) {
echo”
“;
echo”Hello”;
} else {
echo”Bye”;
}

 

http://stackoverflow.com/questions/13821427/convert-year-or-month-into-days-php

http://stackoverflow.com/questions/2191573/php-convert-timestamp-to-months-and-days

http://stackoverflow.com/questions/18269556/php-date-add-1-year-to-current-date

Advertisements
 
Leave a comment

Posted by on November 18, 2014 in PHP

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: