Example #1
0
 /**
  * Created date.
  *
  * @param string $format The date format.
  * @param bool   $local  Use local timezone.
  *
  * @return string Date string.
  */
 public function createdDate($format = '', $local = false)
 {
     $field = $this->config->get('field.created', 'created');
     $format = $format ?: DateTime::$format;
     if ($local) {
         return DateTime::toLocalTime($this->current->{$field}, $format);
     }
     return DateTime::create($this->current->{$field})->format($format);
 }