|
ILIAS
release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
|
@classDescription Date and time handling More...
Inheritance diagram for ilDateTime:
Collaboration diagram for ilDateTime:Public Member Functions | |
| __construct ($a_date=null, $a_format=0, $a_tz='') | |
| Create new date object. More... | |
| __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 Attributes | |
| $log | |
| $timezone = null | |
| $default_timezone = null | |
| $unix = 0 | |
@classDescription Date and time handling
Definition at line 32 of file class.ilDateTime.php.
| ilDateTime::__construct | ( | $a_date = null, |
|
$a_format = 0, |
|||
$a_tz = '' |
|||
| ) |
Create new date object.
@access public
| mixed | integer string following the format given as the second parameter |
| int | format of date presentation |
throws ilDateTimeException
Definition at line 60 of file class.ilDateTime.php.
References $ilLog, ilTimeZone\_getInstance(), IL_CAL_UNIX, and setDate().
Here is the call graph for this function:| 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 539 of file class.ilDateTime.php.
References IL_CAL_DATETIME.
| ilDateTime::__wakeup | ( | ) |
Definition at line 92 of file class.ilDateTime.php.
References $ilLog.
|
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
| 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 219 of file class.ilDateTime.php.
References get(), IL_CAL_DAY, IL_CAL_FKT_DATE, IL_CAL_MONTH, IL_CAL_UNIX, and IL_CAL_YEAR.
Referenced by ilObjGroupAccess\_registrationEnabled(), _within(), ilCalendarRecurrenceCalculator\applyLimits(), ilCalendarRecurrenceCalculator\calculateDateList(), ilCourseRegistrationGUI\fillRegistrationPeriod(), ilGroupRegistrationGUI\fillRegistrationPeriod(), ilConsultationHourBookingTableGUI\fillRow(), ilPageObject\getActive(), ilCalendarAppointmentPanelGUI\getHTML(), ilObjCourse\getSubItems(), ilBookingEntry\isAppointmentBookableForUser(), ilECSCategoryMappingRule\matchesValue(), ilObjGroup\register(), 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
@access 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 156 of file class.ilDateTime.php.
References get(), IL_CAL_DAY, IL_CAL_FKT_DATE, IL_CAL_MONTH, IL_CAL_UNIX, and IL_CAL_YEAR.
Referenced by ilObjGroupAccess\_registrationEnabled(), _within(), ilCalendarBlockGUI\addMiniMonth(), ilMiniCalendarGUI\addMiniMonth(), ilCalendarRecurrenceCalculator\applyLimits(), ilCalendarRecurrenceCalculator\calculateDateList(), ilBookingEntry\cancelBooking(), ilCourseRegistrationGUI\fillRegistrationPeriod(), ilGroupRegistrationGUI\fillRegistrationPeriod(), ilECSServerTableGUI\fillRow(), ilPageObject\getActive(), ilCalendarBlockGUI\getHTML(), ilObjCourse\getSubItems(), ilECSTimePlace\loadFromJson(), ilObjCourseAccess\lookupRegistrationInfo(), ilObjGroupAccess\lookupRegistrationInfo(), ilECSCategoryMappingRule\matchesValue(), ilCalendarRecurrenceCalculator\optimizeStartingTime(), ilUserQuery\query(), ilObjGroup\register(), ilStudyProgramme\setLastChange(), ilStudyProgrammeAssignment\setLastChange(), ilStudyProgrammeProgress\setLastChange(), ilCalendarMonthGUI\show(), ilCalendarPresentationGUI\synchroniseExternalCalendars(), ilObjGroup\validate(), 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.
@access 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_UNIX, and IL_CAL_YEAR.
Referenced by ilCalendarUtil\_isToday(), _within(), ilCalendarBlockGUI\addMiniMonth(), ilMiniCalendarGUI\addMiniMonth(), ilCalendarRecurrenceCalculator\calculateDateList(), ilCalendarAppointmentGUI\edit(), ilSubItemSelectionTableGUI\fillRow(), ilDatePresentation\formatPeriod(), ilDatePresentation\isToday(), ilDatePresentation\isTomorrow(), ilDatePresentation\isYesterday(), ilDateList\removeByDAY(), 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.
| ilDateTime | $dt | |
| ilDateTime | $start | |
| ilDateTime | $end | |
| type | $a_compare_field | |
| type | $a_tz |
Definition at line 247 of file class.ilDateTime.php.
References _after(), _before(), and _equals().
Referenced by ilObjCourse\getSubItems().
Here is the call graph for this function:
Here is the caller graph for this function:| ilDateTime::get | ( | $a_format, | |
$a_format_str = '', |
|||
$a_tz = '' |
|||
| ) |
get formatted date
@access public
| int | format type |
| string | format string |
| string | a specific timezone |
Definition at line 466 of file class.ilDateTime.php.
References $default_timezone, $timezone, ilTimeZone\_getInstance(), getUnixTime(), 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 _after(), _before(), _equals(), ilDatePresentation\formatDate(), ilDatePresentation\formatPeriod(), ilCalendarRecurrenceCalculator\getYearWeekDays(), ilCalendarRegistration\isRegistered(), ilUtil\period2String(), ilStudyProgramme\setLastChange(), ilStudyProgrammeAssignment\setLastChange(), ilStudyProgrammeProgress\setLastChange(), and ilCalendarRegistration\unregister().
Here is the call graph for this function:
Here is the caller graph for this function:| ilDateTime::getTimeZoneIdentifier | ( | ) |
get timezone identifier
@access public
Definition at line 137 of file class.ilDateTime.php.
| ilDateTime::getUnixTime | ( | ) |
get unix time
@access public
Definition at line 308 of file class.ilDateTime.php.
References $unix.
Referenced by get().
Here is the caller graph for this function:| ilDateTime::getUTCOffset | ( | ) |
get UTC offset
@access public
Definition at line 320 of file class.ilDateTime.php.
| ilDateTime::increment | ( | $a_type, | |
$a_count = 1 |
|||
| ) |
increment
@access public
| int | type |
| int | count |
Definition at line 262 of file class.ilDateTime.php.
References $d, $unix, DAY, HOUR, IL_CAL_UNIX, MINUTE, MONTH, WEEK, and YEAR.
Referenced by 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 105 of file class.ilDateTime.php.
Referenced by ilDatePresentation\formatDate().
Here is the caller graph for this function:| ilDateTime::setDate | ( | $a_date, | |
| $a_format | |||
| ) |
set date
@access public
| mixed | date |
| int | format |
Definition at line 337 of file class.ilDateTime.php.
References $timezone, $unix, ilTimeZone\_getInstance(), IL_CAL_DATE, IL_CAL_DATETIME, IL_CAL_FKT_GETDATE, IL_CAL_ISO_8601, IL_CAL_TIMESTAMP, and IL_CAL_UNIX.
Referenced by __construct().
Here is the call graph for this function:
Here is the caller graph for this function:| ilDateTime::switchTimeZone | ( | $a_timezone_identifier = '' | ) |
Switch timezone.
@access public
| string | PHP timezone identifier |
| ilDateTimeException |
Definition at line 117 of file class.ilDateTime.php.
References 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 44 of file class.ilDateTime.php.
Referenced by get().
|
protected |
Definition at line 41 of file class.ilDateTime.php.
|
protected |
Definition at line 43 of file class.ilDateTime.php.
|
protected |
Definition at line 46 of file class.ilDateTime.php.
Referenced by getUnixTime(), increment(), and setDate().
| const ilDateTime::DAY = 'day' |
Definition at line 37 of file class.ilDateTime.php.
Referenced by ilCalendarRecurrenceCalculator\applyBYMONTHDAYRules(), ilCalendarRecurrenceCalculator\applyBYYEARDAYRules(), ilCalendarSchedule\getByDay(), ilCalendarHeaderNavigationGUI\getHTML(), increment(), ilCalendarRecurrenceCalculator\incrementByFrequency(), and ilCalendarDayGUI\show().
| const ilDateTime::HOUR = 'hour' |
Definition at line 38 of file class.ilDateTime.php.
Referenced by ilConsultationHoursGUI\createAppointments(), and increment().
| const ilDateTime::MINUTE = 'minute' |
Definition at line 39 of file class.ilDateTime.php.
Referenced by ilConsultationHoursGUI\createAppointments(), and increment().
| const ilDateTime::MONTH = 'month' |
Definition at line 35 of file class.ilDateTime.php.
Referenced by ilCalendarBlockGUI\addMiniMonth(), ilMiniCalendarGUI\addMiniMonth(), ilCalendarRecurrenceCalculator\applyBYMONTHRules(), ilCalendarHeaderNavigationGUI\getHTML(), increment(), ilCalendarRecurrenceCalculator\incrementByFrequency(), ilCalendarHeaderNavigationGUI\incrementDate(), and ilCalendarMonthGUI\show().
| const ilDateTime::WEEK = 'week' |
Definition at line 36 of file class.ilDateTime.php.
Referenced by ilCalendarRecurrenceCalculator\applyBYWEEKNORules(), ilCalendarHeaderNavigationGUI\getHTML(), increment(), ilCalendarRecurrenceCalculator\incrementByFrequency(), ilObjBookingPoolGUI\renderSlots(), and ilCalendarWeekGUI\show().
| const ilDateTime::YEAR = 'year' |
Definition at line 34 of file class.ilDateTime.php.
Referenced by ilConsultationHoursGUI\createAppointments(), increment(), ilCalendarRecurrenceCalculator\incrementByFrequency(), and ilObjBookingPoolGUI\renderSlots().