|
ILIAS
release_8 Revision v8.24
|
@classDescription Date and time handling More...
Inheritance diagram for ilDateTime:
Collaboration diagram for ilDateTime:Public Member Functions | |
| __construct ($a_date=null, int $a_format=0, string $a_tz='') | |
| Create new date object. More... | |
| __clone () | |
| __sleep () | |
| __wakeup () | |
| isNull () | |
| Check if a date is null (Datetime == '0000-00-00 00:00:00', unixtime == 0,...) More... | |
| switchTimeZone (string $a_timezone_identifier='') | |
| Switch timezone. More... | |
| getTimeZoneIdentifier () | |
| increment (string $a_type, int $a_count=1) | |
| getUnixTime () | |
| setDate ($a_date, int $a_format) | |
| Set date. More... | |
| get (int $a_format, string $a_format_str='', string $a_tz='') | |
| get formatted date More... | |
| __toString () | |
| to string for date time objects Output is user time zone @access public More... | |
Static Public Member Functions | |
| static | _before (ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='') |
| compare two dates and check start is before end This method does not consider tz offsets. More... | |
| static | _equals (ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='') |
| Check if two date are equal. More... | |
| static | _after (ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='') |
| compare two dates and check start is after end This method does not consider tz offsets. More... | |
| static | _within (ilDateTime $dt, ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='') |
| Check whether an date is within a date duration given by start and end. More... | |
Data Fields | |
| const | YEAR = 'year' |
| const | MONTH = 'month' |
| const | WEEK = 'week' |
| const | DAY = 'day' |
| const | HOUR = 'hour' |
| const | MINUTE = 'minute' |
| const | SECOND = 'second' |
Protected Member Functions | |
| parsePartsToDate (int $a_year, int $a_month, int $a_day, ?int $a_hour=null, ?int $a_min=null, ?int $a_sec=null, ?string $a_timezone=null) | |
Protected Attributes | |
| ilLogger | $log |
| ilTimeZone | $timezone = null |
| ilTimeZone | $default_timezone = null |
| DateTime | $dt_obj = null |
@classDescription Date and time handling
Definition at line 28 of file class.ilDateTime.php.
| ilDateTime::__construct | ( | $a_date = null, |
|
| int | $a_format = 0, |
||
| string | $a_tz = '' |
||
| ) |
Create new date object.
| int|string | following the format given as the second parameter |
| int | format |
| string |
| ilDateTimeException |
Definition at line 50 of file class.ilDateTime.php.
References $DIC, ilTimeZone\_getInstance(), and setDate().
Here is the call graph for this function:| ilDateTime::__clone | ( | ) |
Definition at line 66 of file class.ilDateTime.php.
References $dt_obj.
| ilDateTime::__sleep | ( | ) |
Definition at line 73 of file class.ilDateTime.php.
| ilDateTime::__toString | ( | ) |
to string for date time objects Output is user time zone @access public
return
Reimplemented in ilDate.
Definition at line 546 of file class.ilDateTime.php.
References IL_CAL_DATETIME.
| ilDateTime::__wakeup | ( | ) |
Definition at line 78 of file class.ilDateTime.php.
References $DIC.
|
static |
compare two dates and check start is after end This method does not consider tz offsets.
So you have to take care that both dates are defined in the the same timezone @access public
| ilDateTime | |
| ilDateTime | |
| string | field used for comparison. E.g IL_CAL_YEAR checks if start is one or more years after than end |
| string | timezone |
Definition at line 197 of file class.ilDateTime.php.
Referenced by ilObjGroupAccess\_registrationEnabled(), ilCalendarRecurrenceCalculator\applyDurationPeriod(), ilCalendarRecurrenceCalculator\applyLimits(), ilCalendarRecurrenceCalculator\calculateDateList(), ilDateDurationInputGUI\checkInput(), ilAppointmentPresentationConsultationHoursGUI\collectPropertiesAndActions(), ilCourseRegistrationGUI\fillRegistrationPeriod(), ilGroupRegistrationGUI\fillRegistrationPeriod(), ilConsultationHourBookingTableGUI\fillRow(), ilSearchResult\filter(), ilSessionClassificationPathGUI\findSessionContainerForItem(), ilPageObject\getActive(), ilCalendarAppointmentPanelGUI\getHTML(), ilCalendarAgendaListGUI\getHTML(), ilBookingEntry\isAppointmentBookableForUser(), ilECSCategoryMappingRule\matchesValue(), ilObjGroup\register(), ilObjectActivationGUI\update(), ilCourseContentGUI\updateManagedTimings(), ilCourseContentGUI\updatePersonalTimings(), and ilECSCategoryMappingRule\validate().
Here is the caller graph for this function:
|
static |
compare two dates and check start is before end This method does not consider tz offsets.
So you have to take care that both dates are defined in the the same timezone
| ilDateTime | |
| ilDateTime | |
| string | field used for comparison. E.g IL_CAL_YEAR checks if start is one or more years earlier than end |
| string | timezone |
Definition at line 124 of file class.ilDateTime.php.
Referenced by ilObjGroupAccess\_registrationEnabled(), ilMiniCalendarGUI\addMiniMonth(), ilCalendarBlockGUI\addMiniMonth(), ilCalendarRecurrenceCalculator\applyDurationPeriod(), ilCalendarRecurrenceCalculator\applyLimits(), ilCalendarRecurrenceCalculator\calculateDateList(), ilBookingEntry\cancelBooking(), ilCourseRegistrationGUI\fillRegistrationPeriod(), ilGroupRegistrationGUI\fillRegistrationPeriod(), ilECSServerTableGUI\fillRow(), ilSearchResult\filter(), ilPageObject\getActive(), ilCalendarAgendaListGUI\getHTML(), ilCalendarBlockGUI\getHTML(), ilExerciseManagementGUI\handleIndividualDeadlineCallsObject(), ilECSTimePlace\loadFromJson(), ilObjCourseAccess\lookupRegistrationInfo(), ilObjGroupAccess\lookupRegistrationInfo(), ilECSCategoryMappingRule\matchesValue(), ilCalendarRecurrenceCalculator\optimizeEndingTime(), ilCalendarRecurrenceCalculator\optimizeStartingTime(), ilUserQuery\query(), ilObjGroup\register(), ilCalendarMonthGUI\show(), and ilCalendarEntry\validate().
Here is the caller graph for this function:
|
static |
Check if two date are equal.
| ilDateTime | |
| ilDateTime | |
| string | field used for comparison. E.g IL_CAL_YEAR checks if start is the same years than end |
| string | timzone |
Definition at line 159 of file class.ilDateTime.php.
Referenced by ilCalendarUtil\_isToday(), ilMiniCalendarGUI\addMiniMonth(), ilCalendarBlockGUI\addMiniMonth(), ilCalendarRecurrenceCalculator\calculateDateList(), ilCalendarAppointmentGUI\edit(), ilSubItemSelectionTableGUI\fillRow(), ilSearchResult\filter(), ilSessionClassificationPathGUI\findSessionContainerForItem(), ilDatePresentation\formatPeriod(), ilCalendarAgendaListGUI\getHTML(), ilDatePresentation\isToday(), ilDatePresentation\isTomorrow(), ilDatePresentation\isYesterday(), ilDateList\removeByDAY(), ilEmployeeTalkTableGUI\setTalkData(), and ilCalendarMonthGUI\show().
Here is the caller graph for this function:
|
static |
Check whether an date is within a date duration given by start and end.
Definition at line 227 of file class.ilDateTime.php.
Referenced by ilCalendarScheduleFilterTimings\addCustomEvents(), ilCalendarScheduleFilterExercise\addCustomEvents(), and ilCalendarHeaderNavigationGUI\getHTML().
Here is the caller graph for this function:| ilDateTime::get | ( | int | $a_format, |
| string | $a_format_str = '', |
||
| string | $a_tz = '' |
||
| ) |
get formatted date
Reimplemented in ilDate.
Definition at line 466 of file class.ilDateTime.php.
References ilTimeZone\_getInstance(), ilTimeZone\getIdentifier(), IL_CAL_DATE, IL_CAL_DATETIME, IL_CAL_FKT_DATE, IL_CAL_FKT_GETDATE, IL_CAL_ISO_8601, IL_CAL_TIMESTAMP, and IL_CAL_UNIX.
Referenced by ilDateList\add(), ilCalendarWeekGUI\addAppointmentLink(), ilCalendarWeekGUI\addHeaderDate(), ilDatePresentation\formatDate(), ilDatePresentation\formatPeriod(), ilCmiXapiDateTime\fromIliasDateTime(), ilCalendarRegistration\getRegisteredUsers(), ilCalendarRecurrenceCalculator\getYearWeekDays(), ilCalendarRegistration\isRegistered(), ilLTIDataConnector\lookupResourcesForAllUsersSinceDate(), ilLegacyFormElementsUtil\period2String(), ilExcel\prepareDateValue(), ilBookingSchedule\save(), ilCalendarRegistration\unregister(), ilBookingSchedule\update(), ilBlogPosting\update(), and ilCmiXapiUser\updateFetchedUntilForObjects().
Here is the call graph for this function:
Here is the caller graph for this function:| ilDateTime::getTimeZoneIdentifier | ( | ) |
Definition at line 109 of file class.ilDateTime.php.
| ilDateTime::getUnixTime | ( | ) |
Definition at line 303 of file class.ilDateTime.php.
| ilDateTime::increment | ( | string | $a_type, |
| int | $a_count = 1 |
||
| ) |
| string | $a_type | |
| int | $a_count |
Definition at line 255 of file class.ilDateTime.php.
Referenced by ilCalendarRecurrenceCalculator\applyBYDAYRules(), ilCalendarSchedule\getByDay(), ilCalendarSchedule\getChangedEvents(), ilTimingsUser\handleNewMembership(), ilCalendarRecurrenceCalculator\incrementByFrequency(), and ilCalendarSchedule\initPeriod().
Here is the caller graph for this function:| ilDateTime::isNull | ( | ) |
Check if a date is null (Datetime == '0000-00-00 00:00:00', unixtime == 0,...)
Definition at line 88 of file class.ilDateTime.php.
Referenced by ilDatePresentation\formatDate(), ilObjCourseGUI\infoScreen(), ilObjGroupGUI\infoScreen(), ilADTDate\isNull(), ilADTDateTime\isNull(), and ilTestSettingsChangeConfirmationGUI\populateParametersFromPropertyForm().
Here is the caller graph for this function:
|
protected |
Definition at line 311 of file class.ilDateTime.php.
| ilDateTime::setDate | ( | $a_date, | |
| int | $a_format | ||
| ) |
Set date.
| ilDateTimeException |
False "DateTime::ATOM was removed 7.2 warning" is a false positve
@noinspection PhpElementIsNotAvailableInCurrentPhpVersionInspection
Definition at line 360 of file class.ilDateTime.php.
References $message, IL_CAL_DATE, IL_CAL_DATETIME, IL_CAL_FKT_GETDATE, IL_CAL_ISO_8601, IL_CAL_TIMESTAMP, IL_CAL_UNIX, and ilLogLevel\WARNING.
Referenced by __construct().
Here is the caller graph for this function:| ilDateTime::switchTimeZone | ( | string | $a_timezone_identifier = '' | ) |
Switch timezone.
| string | PHP timezone identifier |
| ilDateTimeException |
Definition at line 98 of file class.ilDateTime.php.
References Vendor\Package\$e, and ilTimeZone\_getInstance().
Referenced by ilCalendarRecurrenceCalculator\adjustTimeZones().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Definition at line 40 of file class.ilDateTime.php.
|
protected |
Definition at line 41 of file class.ilDateTime.php.
Referenced by __clone().
|
protected |
Definition at line 38 of file class.ilDateTime.php.
|
protected |
Definition at line 39 of file class.ilDateTime.php.
| const ilDateTime::DAY = 'day' |
Definition at line 33 of file class.ilDateTime.php.
Referenced by ilCalendarRecurrenceCalculator\applyBYMONTHDAYRules(), ilCalendarRecurrenceCalculator\applyBYYEARDAYRules(), ilCalendarSchedule\getByDay(), ilCalendarAgendaListGUI\getHTML(), ilCalendarHeaderNavigationGUI\getHTML(), ILIAS\COPage\History\HistoryDBRepository\getMaxHistEntryPerPageOlderThanX(), ilCalendarRecurrenceCalculator\incrementByFrequency(), ilCalendarRecurrenceCalculator\optimizeEndingTime(), ilLoggerCronCleanErrorFiles\run(), and ilCalendarDayGUI\show().
| const ilDateTime::HOUR = 'hour' |
Definition at line 34 of file class.ilDateTime.php.
Referenced by ilConsultationHoursGUI\createAppointments().
| const ilDateTime::MINUTE = 'minute' |
Definition at line 35 of file class.ilDateTime.php.
Referenced by ilCalendarRecurrenceCalculator\applyDurationPeriod(), and ilConsultationHoursGUI\createAppointments().
| const ilDateTime::MONTH = 'month' |
Definition at line 31 of file class.ilDateTime.php.
Referenced by ilMiniCalendarGUI\addMiniMonth(), ilCalendarRecurrenceCalculator\applyBYMONTHRules(), ilCalendarHeaderNavigationGUI\getHTML(), ilCalendarBlockGUI\getViewControl(), ilCalendarRecurrenceCalculator\incrementByFrequency(), ilCalendarHeaderNavigationGUI\incrementDate(), and ilCalendarMonthGUI\show().
| const ilDateTime::SECOND = 'second' |
Definition at line 36 of file class.ilDateTime.php.
| const ilDateTime::WEEK = 'week' |
Definition at line 32 of file class.ilDateTime.php.
Referenced by ilCalendarRecurrenceCalculator\applyBYWEEKNORules(), ilCalendarHeaderNavigationGUI\getHTML(), ilCalendarRecurrenceCalculator\incrementByFrequency(), and ilCalendarWeekGUI\show().
| const ilDateTime::YEAR = 'year' |
Definition at line 30 of file class.ilDateTime.php.
Referenced by ilConsultationHoursGUI\createAppointments(), and ilCalendarRecurrenceCalculator\incrementByFrequency().