ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilCertificateDateHelper Class Reference
+ Collaboration diagram for ilCertificateDateHelper:

Public Member Functions

 formatDate (string $date, $dateFormat=null)
 
 formatDateTime (string $dateTime, $dateFormat=null)
 

Detailed Description

Author
Niels Theen nthee.nosp@m.n@da.nosp@m.tabay.nosp@m..de

Definition at line 7 of file ilCertificateDateHelper.php.

Member Function Documentation

◆ formatDate()

ilCertificateDateHelper::formatDate ( string  $date,
  $dateFormat = null 
)
Parameters
string$date
int$dateFormat
Returns
string

Definition at line 14 of file ilCertificateDateHelper.php.

14 : string
15 {
16 if (null === $dateFormat) {
17 $dateFormat = IL_CAL_DATETIME;
18 }
19
20 $oldDatePresentationValue = ilDatePresentation::useRelativeDates();
22
23 $date = ilDatePresentation::formatDate(new ilDate($date, $dateFormat));
24
25 ilDatePresentation::setUseRelativeDates($oldDatePresentationValue);
26
27 return $date;
28 }
const IL_CAL_DATETIME
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
static setUseRelativeDates($a_status)
set use relative dates
static useRelativeDates()
check if relative dates are used
Class for single dates.

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

+ Here is the call graph for this function:

◆ formatDateTime()

ilCertificateDateHelper::formatDateTime ( string  $dateTime,
  $dateFormat = null 
)
Parameters
string$dateTime
int$format
Returns
string
Exceptions
ilDateTimeException

Definition at line 36 of file ilCertificateDateHelper.php.

36 : string
37 {
38 if (null === $dateFormat) {
39 $dateFormat = IL_CAL_DATETIME;
40 }
41
42 $oldDatePresentationValue = ilDatePresentation::useRelativeDates();
44
45 $date = ilDatePresentation::formatDate(new ilDateTime($dateTime, $dateFormat));
46
47 ilDatePresentation::setUseRelativeDates($oldDatePresentationValue);
48
49 return $date;
50 }
@classDescription Date and time handling

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

+ Here is the call graph for this function:

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