|
ILIAS
trunk Revision v12.0_alpha-377-g3641b37b9db
|
@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 42 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 64 of file class.ilDateTime.php.
References $DIC, ilTimeZone\_getInstance(), and setDate().
Here is the call graph for this function:| ilDateTime::__clone | ( | ) |
Definition at line 80 of file class.ilDateTime.php.
References $dt_obj.
| ilDateTime::__sleep | ( | ) |
Definition at line 87 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 557 of file class.ilDateTime.php.
References IL_CAL_DATETIME.
| ilDateTime::__wakeup | ( | ) |
Definition at line 92 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 209 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(), 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 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 138 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(), ilPageObject\getActive(), ilCalendarAgendaListGUI\getHTML(), ilCalendarBlockGUI\getHTML(), ilExerciseManagementGUI\handleIndividualDeadlineCallsObject(), ilContainerSessionsContentGUI\initSessionPresentationLimitation(), ILIAS\Calendar\ConsultationHours\BookingDataProvider\isFiltered(), ilECSTimePlace\loadFromJson(), ilObjCourseAccess\lookupRegistrationInfo(), ilObjGroupAccess\lookupRegistrationInfo(), ilECSCategoryMappingRule\matchesValue(), ilCalendarRecurrenceCalculator\optimizeEndingTime(), ilCalendarRecurrenceCalculator\optimizeStartingTime(), 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 172 of file class.ilDateTime.php.
Referenced by ilCalendarUtil\_isToday(), ilMiniCalendarGUI\addMiniMonth(), ilCalendarBlockGUI\addMiniMonth(), ilCalendarRecurrenceCalculator\calculateDateList(), ilCalendarAppointmentGUI\edit(), ilSubItemSelectionTableGUI\fillRow(), ilSessionClassificationPathGUI\findSessionContainerForItem(), 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 238 of file class.ilDateTime.php.
Referenced by ilCalendarScheduleFilterExercise\addCustomEvents(), ilCalendarScheduleFilterTimings\addCustomEvents(), ilCalendarHeaderNavigationGUI\getHTML(), and ilContainerSessionsContentGUI\initSessionPresentationLimitation().
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 477 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\addHeaderDate(), ilCmiXapiDateTime\fromIliasDateTime(), ilCalendarRegistration\getRegisteredUsers(), ilCalendarRecurrenceCalculator\getYearWeekDays(), ilCalendarAppointmentGUI\initInitialDate(), ilCalendarRegistration\isRegistered(), ilLTIDataConnector\lookupResourcesForAllUsersSinceDate(), ilLegacyFormElementsUtil\period2String(), ilExcel\prepareDateValue(), ilBookingSchedule\save(), ilCalendarRegistration\unregister(), ilBookingSchedule\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 123 of file class.ilDateTime.php.
| ilDateTime::getUnixTime | ( | ) |
Definition at line 314 of file class.ilDateTime.php.
| ilDateTime::increment | ( | string | $a_type, |
| int | $a_count = 1 |
||
| ) |
| string | $a_type | |
| int | $a_count |
Definition at line 266 of file class.ilDateTime.php.
Referenced by ilCalendarRecurrenceCalculator\applyBYDAYRules(), ilCalendarSchedule\getByDay(), ilCalendarSchedule\getChangedEvents(), ilTimingsUser\handleNewMembership(), ilCalendarRecurrenceCalculator\incrementByFrequency(), ilCalendarAppointmentGUI\initAppointment(), 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 102 of file class.ilDateTime.php.
Referenced by ilObjCourseGUI\infoScreen(), ilObjGroupGUI\infoScreen(), ilADTDate\isNull(), and ilADTDateTime\isNull().
Here is the caller graph for this function:
|
protected |
Definition at line 322 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 371 of file class.ilDateTime.php.
References 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 112 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 54 of file class.ilDateTime.php.
|
protected |
Definition at line 55 of file class.ilDateTime.php.
Referenced by __clone().
|
protected |
Definition at line 52 of file class.ilDateTime.php.
|
protected |
Definition at line 53 of file class.ilDateTime.php.
| const ilDateTime::DAY = 'day' |
Definition at line 47 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 48 of file class.ilDateTime.php.
Referenced by ilConsultationHoursGUI\createAppointments().
| const ilDateTime::MINUTE = 'minute' |
Definition at line 49 of file class.ilDateTime.php.
Referenced by ilCalendarRecurrenceCalculator\applyDurationPeriod(), and ilConsultationHoursGUI\createAppointments().
| const ilDateTime::MONTH = 'month' |
Definition at line 45 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 50 of file class.ilDateTime.php.
| const ilDateTime::WEEK = 'week' |
| const ilDateTime::YEAR = 'year' |
Definition at line 44 of file class.ilDateTime.php.
Referenced by ilConsultationHoursGUI\createAppointments(), and ilCalendarRecurrenceCalculator\incrementByFrequency().