Elgg  Version 4.3
Go to the documentation of this file.
1 <?php
11 $format = elgg_extract('format', $vars, elgg_get_config('date_format', elgg_echo('input:date_format')), false);
14 if (!$value) {
15  return;
16 }
18 try {
22  'datetime' => $dt->format('c'),
23  ];
25  echo elgg_format_element('time', $attributes, $dt->formatLocale($format));
26 } catch (DataFormatException $ex) {
27  // $value is not a valid datetime, no output
28  return;
29 }
Definition: date.php:39
Definition: date.php:21
Definition: date.php:43
elgg_echo($message_key, array $args=[], $language="")
Elgg language module Functions to manage language and translations.
Definition: languages.php:18
Definition: date.php:23
Definition: time.php:71
elgg_format_element($tag_name, array $attributes=[], $text= '', array $options=[])
Format an HTML element.
Definition: output.php:135
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:547
An exception thrown when there is a problem in the format of some data.
static normalizeTime($time)
Returns DateTime object based on time representation.
Definition: Values.php:76
elgg echo
Translates a string.
Definition: deprecated.js:530
elgg_get_config($name, $default=null)
Get an Elgg configuration value.