ILIAS
trunk Revision v11.0_alpha-1761-g6dbbfa7b760
|
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 64 of file class.ilDateTime.php.
References $DIC, ilTimeZone\_getInstance(), and setDate().
ilDateTime::__clone | ( | ) |
ilDateTime::__sleep | ( | ) |
Definition at line 87 of file class.ilDateTime.php.
ilDateTime::__toString | ( | ) |
to string for date time objects Output is user time zone public
Definition at line 557 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 209 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(), ilGroupRegistrationGUI\fillRegistrationPeriod(), ilCourseRegistrationGUI\fillRegistrationPeriod(), ilConsultationHourBookingTableGUI\fillRow(), ilSearchResult\filter(), ilSessionClassificationPathGUI\findSessionContainerForItem(), ilPageObject\getActive(), ilCalendarAppointmentPanelGUI\getHTML(), ilCalendarAgendaListGUI\getHTML(), ilContainerSessionsContentGUI\initSessionPresentationLimitation(), ilBookingEntry\isAppointmentBookableForUser(), ILIAS\Calendar\ConsultationHours\BookingDataProvider\isFiltered(), ilLPPersonalGUI\isPresentable(), ilECSCategoryMappingRule\matchesValue(), ilObjGroup\register(), 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 138 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(), ilGroupRegistrationGUI\fillRegistrationPeriod(), ilCourseRegistrationGUI\fillRegistrationPeriod(), ilECSServerTableGUI\fillRow(), ilSearchResult\filter(), ilPageObject\getActive(), ilConsultationHourUtils\getConsultationHourLinksForRepositoryObject(), ilCalendarAgendaListGUI\getHTML(), ilCalendarBlockGUI\getHTML(), ilExerciseManagementGUI\handleIndividualDeadlineCallsObject(), ilContainerSessionsContentGUI\initSessionPresentationLimitation(), ILIAS\Calendar\ConsultationHours\BookingDataProvider\isFiltered(), ilLPPersonalGUI\isPresentable(), 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 172 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().
|
static |
Check whether an date is within a date duration given by start and end.
Definition at line 238 of file class.ilDateTime.php.
References _after(), _before(), and _equals().
Referenced by ilCalendarScheduleFilterExercise\addCustomEvents(), ilCalendarScheduleFilterTimings\addCustomEvents(), ilSearchResult\filter(), ilCalendarHeaderNavigationGUI\getHTML(), ilContainerSessionsContentGUI\initSessionPresentationLimitation(), and ilLPPersonalGUI\isPresentable().
ilDateTime::get | ( | int | $a_format, |
string | $a_format_str = '' , |
||
string | $a_tz = '' |
||
) |
get formatted date
Definition at line 477 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(), isNull(), and null.
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().
ilDateTime::getTimeZoneIdentifier | ( | ) |
Definition at line 123 of file class.ilDateTime.php.
Referenced by parsePartsToDate(), and setDate().
ilDateTime::getUnixTime | ( | ) |
Definition at line 314 of file class.ilDateTime.php.
References isNull(), and null.
Referenced by ILIAS\EmployeeTalk\Notification\NotificationHandler\extractFormattedDates(), get(), and increment().
ilDateTime::increment | ( | string | $a_type, |
int | $a_count = 1 |
||
) |
string | $a_type | |
int | $a_count |
Definition at line 266 of file class.ilDateTime.php.
References getUnixTime(), isNull(), and null.
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 102 of file class.ilDateTime.php.
Referenced by _after(), _before(), _equals(), ilDatePresentation\formatDate(), get(), getUnixTime(), and increment().
|
protected |
Definition at line 322 of file class.ilDateTime.php.
References getTimeZoneIdentifier(), ILIAS\Repository\int(), and null.
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 371 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, null, 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 112 of file class.ilDateTime.php.
References Vendor\Package\$e, and ilTimeZone\_getInstance().
Referenced by ilCalendarRecurrenceCalculator\adjustTimeZones().
|
protected |
Definition at line 54 of file class.ilDateTime.php.
Referenced by get().
|
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(), 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 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().