Skip to content

Instantly share code, notes, and snippets.

@cakephp-tutorial
Created February 27, 2016 14:45
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/f340eb2d6064aef673b2 to your computer and use it in GitHub Desktop.
Save cakephp-tutorial/f340eb2d6064aef673b2 to your computer and use it in GitHub Desktop.
<?php
# Ipotizziamo che la data di oggi sia il 15/12/2014
echo $this->Customtime->format(date('2014-12-15 15:20:15'));
# 'Oggi alle 15:20'
echo $this->Customtime->format(date('2014-12-14 15:20:15'));
# 'Ieri alle 15:20'
echo $this->Customtime->format(date('2014-11-14 15:20:15'));
# '14 Novembre'
echo $this->Customtime->format(date('2013-10-14 15:20:15'));
# '14/10/2013'
echo $this->Customtime->format(date('2015-10-14 15:20:15'));
# '14/10/2015'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment