ILIAS
release_8 Revision v8.19
|
Date and time handling More...
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().
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 546 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 197 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\initDetails(), ilBookingEntry\isAppointmentBookableForUser(), ilECSCategoryMappingRule\matchesValue(), ilObjGroup\register(), ilObjectActivationGUI\update(), ilCourseContentGUI\updateManagedTimings(), ilCourseContentGUI\updatePersonalTimings(), and ilECSCategoryMappingRule\validate().
|
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\initDetails(), ilECSTimePlace\loadFromJson(), ilObjGroupAccess\lookupRegistrationInfo(), ilObjCourseAccess\lookupRegistrationInfo(), ilECSCategoryMappingRule\matchesValue(), ilCalendarRecurrenceCalculator\optimizeEndingTime(), ilCalendarRecurrenceCalculator\optimizeStartingTime(), ilUserQuery\query(), ilObjGroup\register(), ilCalendarMonthGUI\show(), and ilCalendarEntry\validate().
|
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.
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(), ilSearchResult\filter(), ilSessionClassificationPathGUI\findSessionContainerForItem(), ilDatePresentation\formatPeriod(), ilCalendarAgendaListGUI\getHTML(), ilDatePresentation\isToday(), ilDatePresentation\isTomorrow(), ilDatePresentation\isYesterday(), ilDateList\removeByDAY(), ilEmployeeTalkTableGUI\setTalkData(), and ilCalendarMonthGUI\show().
|
static |
Check whether an date is within a date duration given by start and end.
Definition at line 227 of file class.ilDateTime.php.
References _after(), _before(), and _equals().
Referenced by ilCalendarScheduleFilterExercise\addCustomEvents(), ilCalendarScheduleFilterTimings\addCustomEvents(), ilCalendarHeaderNavigationGUI\getHTML(), and ilContainerSessionsContentGUI\initDetails().
ilDateTime::get | ( | int | $a_format, |
string | $a_format_str = '' , |
||
string | $a_tz = '' |
||
) |
get formatted date
Definition at line 466 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(), ilCalendarWeekGUI\addAppointmentLink(), 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(), ilObjEmployeeTalkGUI\sendNotification(), ilEmployeeTalkAppointmentGUI\sendNotification(), ilObjEmployeeTalkSeriesGUI\sendNotification(), ilObjEmployeeTalkGUI\sendUpdateNotification(), ilExAssignment\setIndividualDeadline(), ilCalendarRegistration\unregister(), and ilCmiXapiUser\updateFetchedUntilForObjects().
ilDateTime::getTimeZoneIdentifier | ( | ) |
Definition at line 109 of file class.ilDateTime.php.
Referenced by parsePartsToDate(), and setDate().
ilDateTime::getUnixTime | ( | ) |
Definition at line 303 of file class.ilDateTime.php.
References isNull().
Referenced by get(), ilChatroom\getPrivateRoomSessions(), increment(), ilObjEmployeeTalkGUI\sendNotification(), ilEmployeeTalkAppointmentGUI\sendNotification(), ilObjEmployeeTalkSeriesGUI\sendNotification(), and ilObjEmployeeTalkGUI\sendUpdateNotification().
ilDateTime::increment | ( | string | $a_type, |
int | $a_count = 1 |
||
) |
string | $a_type | |
int | $a_count |
Definition at line 255 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().
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().
|
protected |
Definition at line 311 of file class.ilDateTime.php.
References $format, getTimeZoneIdentifier(), and ILIAS\Repository\int().
Referenced by setDate().
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 360 of file class.ilDateTime.php.
References $message, 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().
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().
|
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\COPage\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' |
Definition at line 32 of file class.ilDateTime.php.
Referenced by ilCalendarRecurrenceCalculator\applyBYWEEKNORules(), ilBookingProcessGUI\book(), ilCalendarHeaderNavigationGUI\getHTML(), ilCalendarRecurrenceCalculator\incrementByFrequency(), and ilCalendarWeekGUI\show().
const ilDateTime::YEAR = 'year' |
Definition at line 30 of file class.ilDateTime.php.
Referenced by ilBookingProcessGUI\book(), ilConsultationHoursGUI\createAppointments(), and ilCalendarRecurrenceCalculator\incrementByFrequency().