ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Date and time handling More...
Public Member Functions | |
__construct ($a_date=null, $a_format=0, $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 ($a_timezone_identifier='') | |
Switch timezone. More... | |
getTimeZoneIdentifier () | |
get timezone identifier More... | |
increment ($a_type, $a_count=1) | |
increment More... | |
getUnixTime () | |
get unix time More... | |
getUTCOffset () | |
get UTC offset More... | |
setDate ($a_date, $a_format) | |
Set date. More... | |
get ($a_format, $a_format_str='', $a_tz='') | |
get formatted date More... | |
__toString () | |
to string for date time objects Output is user time zone More... | |
Static Public Member Functions | |
static | _before (ilDateTime $start, ilDateTime $end, $a_compare_field='', $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, $a_compare_field='', $a_tz='') |
Check if two date are equal. More... | |
static | _after (ilDateTime $start, ilDateTime $end, $a_compare_field='', $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, $a_compare_field='', $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' |
Protected Member Functions | |
parsePartsToDate ($a_year, $a_month, $a_day, $a_hour=null, $a_min=null, $a_sec=null, $a_timezone=null) | |
Protected Attributes | |
$log | |
$timezone = null | |
$default_timezone = null | |
$dt_obj | |
ilDateTime::__construct | ( | $a_date = null , |
|
$a_format = 0 , |
|||
$a_tz = '' |
|||
) |
Create new date object.
public
mixed | integer string following the format given as the second parameter |
int | format of date presentation |
Definition at line 63 of file class.ilDateTime.php.
References $ilLog, ilTimeZone\_getInstance(), setDate(), and timezone.
ilDateTime::__clone | ( | ) |
ilDateTime::__sleep | ( | ) |
ilDateTime::__toString | ( | ) |
to string for date time objects Output is user time zone
public
Definition at line 569 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
object | ilDateTime |
object | 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 222 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(), ilPageObject\getActive(), ilCalendarAppointmentPanelGUI\getHTML(), ilCalendarAgendaListGUI\getHTML(), ilObjCourse\getSubItems(), ilBookingEntry\isAppointmentBookableForUser(), ilECSCategoryMappingRule\matchesValue(), ilObjGroup\register(), 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
public
object | ilDateTime |
object | 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 152 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(), ilCalendarMonthGUI\addScheduleFilter(), ilCalendarRecurrenceCalculator\applyDurationPeriod(), ilCalendarRecurrenceCalculator\applyLimits(), ilCalendarRecurrenceCalculator\calculateDateList(), ilBookingEntry\cancelBooking(), ilCourseRegistrationGUI\fillRegistrationPeriod(), ilGroupRegistrationGUI\fillRegistrationPeriod(), ilECSServerTableGUI\fillRow(), ilPageObject\getActive(), ilCalendarAgendaListGUI\getHTML(), ilCalendarBlockGUI\getHTML(), ilObjCourse\getSubItems(), ilExerciseManagementGUI\handleIndividualDeadlineCallsObject(), ilECSTimePlace\loadFromJson(), ilObjGroupAccess\lookupRegistrationInfo(), ilObjCourseAccess\lookupRegistrationInfo(), ilECSCategoryMappingRule\matchesValue(), ilCalendarRecurrenceCalculator\optimizeStartingTime(), ilUserQuery\query(), ilObjGroup\register(), ilStudyProgrammeAssignment\setLastChange(), ilStudyProgramme\setLastChange(), ilStudyProgrammeProgress\setLastChange(), ilCalendarPresentationGUI\synchroniseExternalCalendars(), and ilCalendarEntry\validate().
|
static |
Check if two date are equal.
public
object | ilDateTime |
object | 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 187 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(), ilCalendarMonthGUI\addScheduleFilter(), ilCalendarRecurrenceCalculator\calculateDateList(), ilCalendarAppointmentGUI\edit(), ilSubItemSelectionTableGUI\fillRow(), ilDatePresentation\formatPeriod(), ilCalendarAgendaListGUI\getHTML(), ilDatePresentation\isToday(), ilDatePresentation\isTomorrow(), ilDatePresentation\isYesterday(), and ilDateList\removeByDAY().
|
static |
Check whether an date is within a date duration given by start and end.
ilDateTime | $dt | |
ilDateTime | $start | |
ilDateTime | $end | |
type | $a_compare_field | |
type | $a_tz |
Definition at line 253 of file class.ilDateTime.php.
References _after(), _before(), and _equals().
Referenced by ilCalendarScheduleFilterExercise\addCustomEvents(), ilCalendarHeaderNavigationGUI\getHTML(), and ilObjCourse\getSubItems().
ilDateTime::get | ( | $a_format, | |
$a_format_str = '' , |
|||
$a_tz = '' |
|||
) |
get formatted date
public
int | format type |
string | format string |
string | a specific timezone |
Definition at line 496 of file class.ilDateTime.php.
References $default_timezone, $timezone, ilTimeZone\_getInstance(), array, 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, and isNull().
Referenced by _after(), _before(), _equals(), ilConsultationHourUtils\findCalendarAppointmentsForBooking(), ilDatePresentation\formatDate(), ilDatePresentation\formatPeriod(), ilCalendarSchedule\getByDay(), ilCalendarRecurrenceCalculator\getYearWeekDays(), ilCalendarRegistration\isRegistered(), ilLTIDataConnector\lookupResourcesForAllUsersSinceDate(), ilUtil\period2String(), ilExcel\prepareDateValue(), ilExAssignment\setIndividualDeadline(), ilStudyProgrammeAssignment\setLastChange(), ilStudyProgramme\setLastChange(), ilStudyProgrammeProgress\setLastChange(), and ilCalendarRegistration\unregister().
ilDateTime::getTimeZoneIdentifier | ( | ) |
get timezone identifier
public
Definition at line 133 of file class.ilDateTime.php.
References timezone.
Referenced by parsePartsToDate(), and setDate().
ilDateTime::getUnixTime | ( | ) |
get unix time
public
Definition at line 320 of file class.ilDateTime.php.
References isNull().
Referenced by get(), and increment().
ilDateTime::getUTCOffset | ( | ) |
get UTC offset
public
Definition at line 333 of file class.ilDateTime.php.
References isNull().
ilDateTime::increment | ( | $a_type, | |
$a_count = 1 |
|||
) |
increment
public
int | type |
int | count |
Definition at line 268 of file class.ilDateTime.php.
References $a_type, getUnixTime(), and isNull().
Referenced by ilCalendarSchedule\getByDay(), ilCalendarSchedule\initPeriod(), ilDatePresentation\isTomorrow(), ilDatePresentation\isYesterday(), and ilICalParser\writeEvent().
ilDateTime::isNull | ( | ) |
Check if a date is null (Datetime == '0000-00-00 00:00:00', unixtime == 0,...)
Definition at line 104 of file class.ilDateTime.php.
Referenced by _after(), _before(), _equals(), ilDatePresentation\formatDate(), get(), getUnixTime(), getUTCOffset(), and increment().
|
protected |
Definition at line 345 of file class.ilDateTime.php.
References $format, and getTimeZoneIdentifier().
Referenced by setDate().
ilDateTime::setDate | ( | $a_date, | |
$a_format | |||
) |
Set date.
public
mixed | date |
int | format |
ilDateTimeException |
Definition at line 392 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, and parsePartsToDate().
Referenced by __construct(), ilUserProfile\addStandardFieldsToForm(), arEditGUI\afterFillForm(), and ilExAssignmentEditorGUI\setDisabledFieldValues().
ilDateTime::switchTimeZone | ( | $a_timezone_identifier = '' | ) |
Switch timezone.
public
string | PHP timezone identifier |
ilDateTimeException |
Definition at line 116 of file class.ilDateTime.php.
References ilTimeZone\_getInstance(), and timezone.
Referenced by ilCalendarRecurrenceCalculator\adjustTimeZones().
|
protected |
Definition at line 44 of file class.ilDateTime.php.
Referenced by get().
|
protected |
Definition at line 49 of file class.ilDateTime.php.
Referenced by __clone().
|
protected |
Definition at line 41 of file class.ilDateTime.php.
|
protected |
Definition at line 43 of file class.ilDateTime.php.
Referenced by get().
const ilDateTime::DAY = 'day' |
Definition at line 37 of file class.ilDateTime.php.
Referenced by ilCalendarRecurrenceCalculator\applyBYMONTHDAYRules(), ilCalendarRecurrenceCalculator\applyBYYEARDAYRules(), ilCalendarDayGUI\executeCommand(), ilCalendarSchedule\getByDay(), ilCalendarHeaderNavigationGUI\getHTML(), ilCalendarAgendaListGUI\getHTML(), ilCalendarRecurrenceCalculator\incrementByFrequency(), ilBookingReservationsTableGUI\initFilter(), and ilLoggerCronCleanErrorFiles\run().
const ilDateTime::HOUR = 'hour' |
Definition at line 38 of file class.ilDateTime.php.
Referenced by ilConsultationHoursGUI\createAppointments().
const ilDateTime::MINUTE = 'minute' |
Definition at line 39 of file class.ilDateTime.php.
Referenced by ilCalendarRecurrenceCalculator\applyDurationPeriod(), and ilConsultationHoursGUI\createAppointments().
const ilDateTime::MONTH = 'month' |
Definition at line 35 of file class.ilDateTime.php.
Referenced by ilMiniCalendarGUI\addMiniMonth(), ilCalendarBlockGUI\addMiniMonth(), ilCalendarMonthGUI\addScheduleFilter(), ilCalendarRecurrenceCalculator\applyBYMONTHRules(), ilCalendarHeaderNavigationGUI\getHTML(), ilCalendarRecurrenceCalculator\incrementByFrequency(), and ilCalendarHeaderNavigationGUI\incrementDate().
const ilDateTime::WEEK = 'week' |
Definition at line 36 of file class.ilDateTime.php.
Referenced by ilCalendarRecurrenceCalculator\applyBYWEEKNORules(), ilCalendarHeaderNavigationGUI\getHTML(), ilCalendarRecurrenceCalculator\incrementByFrequency(), ilObjBookingPoolGUI\renderSlots(), and ilCalendarWeekGUI\show().
const ilDateTime::YEAR = 'year' |
Definition at line 34 of file class.ilDateTime.php.
Referenced by ilConsultationHoursGUI\createAppointments(), ilCalendarRecurrenceCalculator\incrementByFrequency(), and ilObjBookingPoolGUI\renderSlots().