Jump to content

Featured Replies

Hi,

how can i make that code to check in months and years (both) or month or year separately? Thanks.

<div class="custom">
 {{$date_joined = floor((strtotime("now")-strtotime("{$comment->author()->joined}"))/86400) ;}}  
<span class="leftinfo"><i class="fa fa-calendar"></i> $time of fappig:</span>
<span class="rightinfo">{$date_joined} Days</span>
</div>              

 

Link to comment
https://ipbmafia.ru/topic/22712-how-to-remake-checking-in-months/
Share on other sites

Something like

$ct = DateTime::createFromFormat('U', time());
$jt = DateTime::createFromFormat('U', $comment->author()->joined);
$delta = $jt->diff($ct);
$years = $delta->format('%y'); 
$month = $delta->format('%m');
echo "Fapping with us {$years} year and {$month} months";

Link to comment
https://ipbmafia.ru/topic/22712-how-to-remake-checking-in-months/?&do=findComment&comment=166285
Share on other sites

Good, but i got an error.

[[Template forums/front/topics/postContainer is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]

Link to comment
https://ipbmafia.ru/topic/22712-how-to-remake-checking-in-months/?&do=findComment&comment=166297
Share on other sites
{{$ct=\DateTime::createFromFormat('U',\time());$jt=\DateTime::createFromFormat('U',$comment->author()->joined);$delta=$jt->diff($ct);$years=$delta->format('%y');$month=$delta->format('%m');}}

<div class="custom">
<span class="leftinfo"><i class="fa fa-calendar"></i>Fapping with us</span> 
<span class="rightinfo">{$years} year and {$month} months</span>
</div> 

 

Link to comment
https://ipbmafia.ru/topic/22712-how-to-remake-checking-in-months/?&do=findComment&comment=166298
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.


Guest
Ответить в этой теме...

Последние посетители 0

  • No registered users viewing this page.