Skip to content

Instantly share code, notes, and snippets.

@cakephp-tutorial
Created February 27, 2016 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cakephp-tutorial/23bc686d8d6fab2fc2b9 to your computer and use it in GitHub Desktop.
Save cakephp-tutorial/23bc686d8d6fab2fc2b9 to your computer and use it in GitHub Desktop.
<?php
echo $this->Customtime->timeAgo(date('2014-12-15 15:20:15'));
# '1 ora fa'
echo $this->Customtime->timeAgo(date('2014-12-15 08:20:15'));
# 'Oggi alle 08:20'
echo $this->Customtime->timeAgo(date('2014-11-14 20:20:15'));
# '14 Novembre'
echo $this->Customtime->timeAgo(date('2014-12-10 20:20:15'));
# 'Mercoledì 10 Dicembre alle 20:20'
echo $this->Customtime->timeAgo(date('2013-11-10 15:20:15'));
# '10/11/2013'
echo $this->Customtime->timeAgo(date('2015-11-10 15:20:15'));
# '10/11/2013'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment