title: Using Carbon api for date time codeigniter
body: <p>I'm trying to use Carbon API(<a href="https://github.com/briannesbitt/Carbon" rel="nofollow">https://github.com/briannesbitt/Carbon</a>) for my project in Codeigniter. But I am having trouble using it.
  I first installed it with composer. But when I use the following code in my project:</p>
  
  <pre><code>require 'vendor/autoload.php';
  use Carbon\Carbon;
  printf("Now: %s", Carbon::now());
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>syntax error, unexpected 'use' (T_USE) in ...
  </code></pre>
  
  <p>So, I tried installing it manually(Copy and past the Carbon class file to my project). Then it worked fine when I tested the following code:</p>
  
  <pre><code> $now = Carbon::now();
   die($now);
  </code></pre>
  
  <p>But when I try to run something like this:</p>
  
  <pre><code>$dtKtm = Carbon::createFromFormat('Y-m-d H:i:s', $data['banners'][0]['date_added']); 
  echo Carbon::now()-&gt;diffForHumans($dtKtm, false);
  </code></pre>
  
  <blockquote>
    <p>It gives me " Class 'Translator' not found" error.</p>
  </blockquote>
  
  <p>Can anyone help me fix this.</p>