Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Carbon Add Years To Date In Laravel

<?php
  
namespace AppHttpControllers;
  
use IlluminateHttpRequest;
use CarbonCarbon;
  
class DateController extends Controller
{
    public function index()
    {
        $currentDateTime = Carbon::now();
        $newDateTime = Carbon::now()->addYear();
             
        print_r($currentDateTime);
        print_r($newDateTime);
    }
}
Source by techsolutionstuff.com #
 
PREVIOUS NEXT
Tagged: #Carbon #Add #Years #To #Date #In #Laravel
ADD COMMENT
Topic
Name
4+7 =