Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

different days in carbon laravel between different dates

$created = new Carbon($survey->created_at);
$now = Carbon::now();
$difference = ($created->diff($now)->days < 1)
    ? 'today'
    : $created->diffForHumans($now);
 
PREVIOUS NEXT
Tagged: #days #carbon #laravel #dates
ADD COMMENT
Topic
Name
3+8 =