ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
trait.ilDclDatetimeRecordDateFormatter.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 {
23  protected function formatDateFromString(string $value): string
24  {
25  return $this->formatDateFromInt(strtotime($value));
26  }
27 
28  protected function formatDateFromInt(int $timestamp): string
29  {
30  $format = $this->getUserDateFormat();
31  switch ($format) {
33  return date("d.m.Y", $timestamp);
35  return date("Y-m-d", $timestamp);
37  return date("m/d/Y", $timestamp);
38  default:
39  return date($format, $timestamp);
40  }
41 
42  return $this->lng->txt('no_date');
43  }
44 
45  abstract protected function getUserDateFormat(): string;
46 }
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:70