|
ILIAS
release_10 Revision v10.1-43-ga1241a92c2f
|
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 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 |
| 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 | ( | ) |
| ilDateTime::__sleep | ( | ) |
Definition at line 73 of file class.ilDateTime.php.
| ilDateTime::__toString | ( | ) |
to string for date time objects Output is user time zone public
Definition at line 543 of file class.ilDateTime.php.
References IL_CAL_DATETIME.
| ilDateTime::__wakeup | ( | ) |
|
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 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 195 of file class.ilDateTime.php.
References get(), IL_CAL_DAY, IL_CAL_FKT_DATE, IL_CAL_MONTH, IL_CAL_YEAR, and isNull().
Referenced by ilObjGroupAccess\_registrationEnabled(), _within(), 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(), ilContainerSessionsContentGUI\initSessionPresentationLimitation(), ilBookingEntry\isAppointmentBookableForUser(), ILIAS\Calendar\ConsultationHours\BookingDataProvider\isFiltered(), ilECSCategoryMappingRule\matchesValue(), ilObjGroup\register(), ilCourseContentGUI\updateManagedTimings(), ilCourseContentGUI\updatePersonalTimings(), and ilECSCategoryMappingRule\validate().
Here is the call graph for this function:
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.
References get(), IL_CAL_DAY, IL_CAL_FKT_DATE, IL_CAL_MONTH, IL_CAL_YEAR, and isNull().
Referenced by ilObjGroupAccess\_registrationEnabled(), _within(), ilMiniCalendarGUI\addMiniMonth(), ilCalendarBlockGUI\addMiniMonth(), ilCalendarRecurrenceCalculator\applyDurationPeriod(), ilCalendarRecurrenceCalculator\applyLimits(), ilCalendarRecurrenceCalculator\calculateDateList(), ilBookingEntry\cancelBooking(), ilCourseRegistrationGUI\fillRegistrationPeriod(), ilGroupRegistrationGUI\fillRegistrationPeriod(), ilECSServerTableGUI\fillRow(), ilSearchResult\filter(), ilPageObject\getActive(), ilConsultationHourUtils\getConsultationHourLinksForRepositoryObject(), ilCalendarAgendaListGUI\getHTML(), ilCalendarBlockGUI\getHTML(), ilExerciseManagementGUI\handleIndividualDeadlineCallsObject(), ilContainerSessionsContentGUI\initSessionPresentationLimitation(), ILIAS\Calendar\ConsultationHours\BookingDataProvider\isFiltered(), ilECSTimePlace\loadFromJson(), ilObjGroupAccess\lookupRegistrationInfo(), ilObjCourseAccess\lookupRegistrationInfo(), ilECSCategoryMappingRule\matchesValue(), ilCalendarRecurrenceCalculator\optimizeEndingTime(), ilCalendarRecurrenceCalculator\optimizeStartingTime(), ilUserQuery\query(), ilObjGroup\register(), ilCalendarMonthGUI\show(), and ilCalendarEntry\validate().
Here is the call graph for this function:
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 158 of file class.ilDateTime.php.
References get(), IL_CAL_DAY, IL_CAL_FKT_DATE, IL_CAL_MONTH, IL_CAL_YEAR, and isNull().
Referenced by ilCalendarUtil\_isToday(), _within(), ilMiniCalendarGUI\addMiniMonth(), ilCalendarBlockGUI\addMiniMonth(), ilCalendarRecurrenceCalculator\calculateDateList(), ilCalendarAppointmentGUI\edit(), ilSubItemSelectionTableGUI\fillRow(), ilSessionClassificationPathGUI\findSessionContainerForItem(), ilDatePresentation\formatPeriod(), ilCalendarAgendaListGUI\getHTML(), ilDatePresentation\isToday(), ilDatePresentation\isTomorrow(), ilDatePresentation\isYesterday(), ilDateList\removeByDAY(), ilEmployeeTalkTableGUI\setTalkData(), and ilCalendarMonthGUI\show().
Here is the call graph for this function:
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 224 of file class.ilDateTime.php.
References _after(), _before(), and _equals().
Referenced by ilCalendarScheduleFilterExercise\addCustomEvents(), ilCalendarScheduleFilterTimings\addCustomEvents(), ilSearchResult\filter(), ilCalendarHeaderNavigationGUI\getHTML(), and ilContainerSessionsContentGUI\initSessionPresentationLimitation().
Here is the call graph for this function:
Here is the caller graph for this function:| ilDateTime::get | ( | int | $a_format, |
| string | $a_format_str = '', |
||
| string | $a_tz = '' |
||
| ) |
get formatted date
Definition at line 463 of file class.ilDateTime.php.
References $default_timezone, ilTimeZone\_getInstance(), ilTimeZone\getIdentifier(), getUnixTime(), IL_CAL_DATE, IL_CAL_DATETIME, IL_CAL_FKT_DATE, IL_CAL_FKT_GETDATE, IL_CAL_ISO_8601, IL_CAL_TIMESTAMP, IL_CAL_UNIX, ILIAS\Repository\int(), and isNull().
Referenced by _after(), _before(), _equals(), ilDateList\add(), ILIAS\BookingManager\BookingProcess\BookingProcessManager\bookAvailableObjects(), ilConsultationHourUtils\findCalendarAppointmentsForBooking(), ilDatePresentation\formatDate(), ilDatePresentation\formatPeriod(), ilCmiXapiDateTime\fromIliasDateTime(), ilCalendarSchedule\getByDay(), ilCalendarHeaderNavigationGUI\getHTML(), ilCalendarRegistration\getRegisteredUsers(), ilCalendarRecurrenceCalculator\getYearWeekDays(), ilCalendarRegistration\isRegistered(), ilLTIDataConnector\lookupResourcesForAllUsersSinceDate(), ilCalendarWeekGUI\parseHourInfo(), ilLegacyFormElementsUtil\period2String(), ilExcel\prepareDateValue(), ilChatroomHistoryGUI\renderDateTimeInformation(), ilExAssignment\setIndividualDeadline(), ilCalendarRegistration\unregister(), 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.
Referenced by parsePartsToDate(), and setDate().
Here is the caller graph for this function:| ilDateTime::getUnixTime | ( | ) |
Definition at line 300 of file class.ilDateTime.php.
References isNull().
Referenced by ILIAS\EmployeeTalk\Notification\NotificationHandler\extractFormattedDates(), get(), and increment().
Here is the call graph for this function:
Here is the caller graph for this function:| ilDateTime::increment | ( | string | $a_type, |
| int | $a_count = 1 |
||
| ) |
| string | $a_type | |
| int | $a_count |
Definition at line 252 of file class.ilDateTime.php.
References getUnixTime(), and isNull().
Referenced by ilCalendarRecurrenceCalculator\applyBYDAYRules(), ilCalendarSchedule\getByDay(), ilCalendarSchedule\getChangedEvents(), ilTimingsUser\handleNewMembership(), ilCalendarRecurrenceCalculator\incrementByFrequency(), ilCalendarAppointmentGUI\initAppointment(), ilCalendarAgendaListGUI\initEndPeriod(), and ilCalendarSchedule\initPeriod().
Here is the call graph for this function:
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 _after(), _before(), _equals(), ilDatePresentation\formatDate(), get(), getUnixTime(), and increment().
Here is the caller graph for this function:
|
protected |
Definition at line 308 of file class.ilDateTime.php.
References getTimeZoneIdentifier(), and ILIAS\Repository\int().
Referenced by setDate().
Here is the call graph for this function:
Here is the caller graph for this function:| ilDateTime::setDate | ( | $a_date, | |
| int | $a_format | ||
| ) |
Set date.
| ilDateTimeException |
False "DateTime::ATOM was removed 7.2 warning" is a false positve
PhpElementIsNotAvailableInCurrentPhpVersionInspection
Definition at line 357 of file class.ilDateTime.php.
References getTimeZoneIdentifier(), IL_CAL_DATE, IL_CAL_DATETIME, IL_CAL_FKT_GETDATE, IL_CAL_ISO_8601, IL_CAL_TIMESTAMP, IL_CAL_UNIX, parsePartsToDate(), and ilLogLevel\WARNING.
Referenced by __construct(), and ilExAssignmentEditorGUI\setDisabledFieldValues().
Here is the call graph for this function:
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.
Referenced by get().
|
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(), ilCalendarHeaderNavigationGUI\getHTML(), ilCalendarAgendaListGUI\getHTML(), ILIAS\LegalDocuments\Provide\History\HistoryDBRepository\getMaxHistEntryPerPageOlderThanX(), ilCalendarRecurrenceCalculator\incrementByFrequency(), ilBookingReservationsTableGUI\initFilter(), 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' |
| const ilDateTime::YEAR = 'year' |
Definition at line 30 of file class.ilDateTime.php.
Referenced by ilConsultationHoursGUI\createAppointments(), and ilCalendarRecurrenceCalculator\incrementByFrequency().