Jump to content

Featured Replies

Posted
comment_166280

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>              

 

comment_166285

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";

  • Author
comment_166297

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.]]

comment_166298
{{$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> 

 

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.