示例#1
0
 /**
  * Format a given date.
  *
  * @param  $timestamp  string  date the date you wish to format
  * @param  $format  string  the desired format
  * @param  $locale   string  the locale
  *
  * @return string Formatted date
  */
 function date_formater($timestamp, $format = '%A, %d %B %Y %H:%M', $locale = 'fr')
 {
     setlocale(LC_TIME, $locale . '_CA.UTF-8');
     $dt = new Carbon\Carbon($timestamp);
     return $dt->formatLocalized($format);
 }