ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilCertificateDateHelper Class Reference
+ Collaboration diagram for ilCertificateDateHelper:

Public Member Functions

 formatDate ($date, ?ilObjUser $user=null, ?int $dateFormat=null)
 
 formatDateTime ($dateTime, ?ilObjuser $user=null, ?int $dateFormat=null)
 

Detailed Description

Definition at line 21 of file ilCertificateDateHelper.php.

Member Function Documentation

◆ formatDate()

ilCertificateDateHelper::formatDate (   $date,
?ilObjUser  $user = null,
?int  $dateFormat = null 
)
Parameters
string | int$date

Definition at line 26 of file ilCertificateDateHelper.php.

References ilDatePresentation\formatDate(), IL_CAL_DATETIME, null, ilDatePresentation\setUseRelativeDates(), and ilDatePresentation\useRelativeDates().

26  : string
27  {
28  if (null === $dateFormat) {
29  require_once __DIR__ . '/../../../Calendar/classes/class.ilDateTime.php'; // Required because of global constant IL_CAL_DATE
30  $dateFormat = IL_CAL_DATETIME;
31  }
32 
33  $oldDatePresentationValue = ilDatePresentation::useRelativeDates();
36  new ilDate($date, $dateFormat),
37  false,
38  false,
39  false,
40  $user
41  );
42  ilDatePresentation::setUseRelativeDates($oldDatePresentationValue);
43 
44  return $date;
45  }
static array static setUseRelativeDates(bool $a_status)
set use relative dates
const IL_CAL_DATETIME
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
+ Here is the call graph for this function:

◆ formatDateTime()

ilCertificateDateHelper::formatDateTime (   $dateTime,
?ilObjuser  $user = null,
?int  $dateFormat = null 
)
Parameters
string | int$dateTime
Exceptions
ilDateTimeException

Definition at line 51 of file ilCertificateDateHelper.php.

References ilDatePresentation\formatDate(), IL_CAL_DATETIME, null, ilDatePresentation\setUseRelativeDates(), and ilDatePresentation\useRelativeDates().

51  : string
52  {
53  if (null === $dateFormat) {
54  require_once __DIR__ . '/../../../Calendar/classes/class.ilDateTime.php'; // Required because of global constant IL_CAL_DATE
55  $dateFormat = IL_CAL_DATETIME;
56  }
57 
58  $oldDatePresentationValue = ilDatePresentation::useRelativeDates();
60 
62  new ilDateTime($dateTime, $dateFormat),
63  false,
64  false,
65  false,
66  $user
67  );
68 
69  ilDatePresentation::setUseRelativeDates($oldDatePresentationValue);
70 
71  return $date;
72  }
static array static setUseRelativeDates(bool $a_status)
set use relative dates
const IL_CAL_DATETIME
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: