Skip to content

Instantly share code, notes, and snippets.

@cakephp-tutorial
Created February 27, 2016 14:47
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/85da9453bdb7fa8f5f1a to your computer and use it in GitHub Desktop.
Save cakephp-tutorial/85da9453bdb7fa8f5f1a to your computer and use it in GitHub Desktop.
<?php
$this->Customtime->timeLeft(date('2014-12-15 18:20:15'));
# 'Oggi alle 18:20'
$this->Customtime->timeLeft(date('2014-12-18 15:20:15'));
# 'Tra 3 giorni alle 15:20'
$this->Customtime->timeLeft(date('2014-12-21 08:20:15'));
# 'Tra 6 giorni alle 08:20'
$this->Customtime->timeLeft(date('2015-01-14 20:20:15'));
# '14/01/2015'
$this->Customtime->timeLeft(date('2014-12-10 20:20:15'));
# '10/12/2014'
$this->Customtime->timeLeft(date('2013-11-10 15:20:15'));
# '10/11/2013'
$this->Customtime->timeLeft(date('2015-11-10 15:20:15'));
# '10/11/2015'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment