Advertisement
rAthus

Affichage amélioré d'une date

Sep 2nd, 2013
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1. setlocale (LC_TIME, 'fr_FR.utf8','fra');
  2. $date = TIMESTAMP; // Timestamp de la date à afficher
  3. $date_affichee = ((date('d/m/Y',$date)!=date('d/m/Y') and date('d/m/Y',$date)!=date('d/m/Y',time()-60*60*24))?((date('z',$date)>=date('z')-7)?strftime('%A ',$date).((date('z',$date)==date('z')-7)?'dernier ':''):date('\l\e d/m/Y ',$date)):((date('d/m/Y',$date)==date('d/m/Y'))?'aujourd\'hui ':'hier ')).date('à H\hi',$date);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement