Property | Type | Description | |
---|---|---|---|
$_corrections | array | Map of required correction masks. | |
$_defaultFormat | string | Default format for __toString() | |
$_defaultSpecs | string | Default specs that are always supported. | |
$_formatCache | |||
$_hour | integer | Hour | |
$_mday | integer | Day | |
$_min | integer | Minute | |
$_month | integer | Month | |
$_sec | integer | Second | |
$_supportedSpecs | string | Internally supported strftime() specifiers. | |
$_timezone | string | String representation of the date's timezone. | |
$_timezoneAbbreviations | array | These aliases map timezone abbreviations to those understood by PHP. | |
$_timezoneAliases | array | These aliases map Windows, Lotus, and other Timezone IDs to those understood by PHP. | |
$_timezoneIdentifiers | array | A list of (Olson) timezone identifiers understood by PHP. | |
$_year | integer | Year |
Method | Description | |
---|---|---|
__construct ( $date = null, $timezone = null ) | Builds a new date object. If $date contains date parts, use them to initialize the object. | |
__get ( string $name ) : integer | string | Getter for the date and time properties. | |
__isset ( string $name ) : boolen | Returns whether a date or time property exists. | |
__set ( string $name, integer | string $value ) | Setter for the date and time properties. | |
__toString ( ) : string | Returns a simple string representation of the date object | |
add ( $factor ) | Adds a number of seconds or units to this date, returning a new Date object. | |
after ( mixed $other ) : boolean | Returns whether this date is after the other. | |
before ( mixed $other ) : boolean | Returns whether this date is before the other. | |
compareDate ( mixed $other ) : integer | Compares this date to another date object to see which one is greater (later). Assumes that the dates are in the same timezone. | |
compareDateTime ( mixed $other ) : integer | Compares this to another date object, including times, to see which one is greater (later). Assumes that the dates are in the same timezone. | |
compareTime ( mixed $other ) : integer | Compares this to another date object by time, to see which one is greater (later). Assumes that the dates are in the same timezone. | |
dateString ( ) : string | Formats date and time to be passed around as a short url parameter. | |
datestamp ( ) : integer | Returns the unix timestamp representation of this date, 12:00am. | |
dayOfWeek ( ) : integer | Returns the day of the week (0 = Sunday, 6 = Saturday) of this date. | |
dayOfYear ( ) : integer | Returns the day number of the year (1 to 365/366). | |
diff ( Horde_Date $other ) : integer | Returns number of days between this date and another. | |
equals ( mixed $other ) : boolean | Returns whether this date is the same like the other. | |
format ( string $format ) : string | Formats time using the specifiers available in date() or in the DateTime class' format() method. | |
fromDays ( integer $days ) : Horde_Date | Converts number of days since 24th November, 4714 B.C. (in the proleptic Gregorian calendar, which is year -4713 using 'Astronomical' year numbering) to Gregorian calendar date. | |
getTimezoneAlias ( string $timezone ) : string | Returns the normalized (Olson) timezone name of a timezone alias. | |
isValid ( ) : boolean | Is the date currently represented by this object a valid date? | |
setDefaultFormat ( string $format ) | Sets the default date format used in __toString() | |
setNthWeekday ( integer $weekday, integer $nth = 1 ) | Sets the date of this object to the $nth weekday of $weekday. | |
setTimezone ( string $timezone ) : Horde_Date | Converts this object to a different timezone. | |
strftime ( $format ) : string | Formats date and time using strftime() format. | |
sub ( $factor ) | Subtracts a number of seconds or units from this date, returning a new Horde_Date object. | |
timestamp ( ) : integer | Returns the unix timestamp representation of this date. | |
toDateTime ( ) : DateTime | Returns a DateTime object representing this object. | |
toDays ( ) : integer | Converts a date in the proleptic Gregorian calendar to the no of days since 24th November, 4714 B.C. | |
toJson ( ) : string | Formats date and time to the ISO format used by JSON. | |
toiCalendar ( boolean $floating = false ) : string | Formats date and time to the RFC 2445 iCalendar DATE-TIME format. | |
tzOffset ( boolean $colon = true ) : string | Returns the time offset for local time zone. | |
weekOfMonth ( ) : integer | Returns the week of the month. | |
weekOfYear ( ) : integer | Returns the week of the year, first Monday is first day of first week. | |
weeksInYear ( integer $year ) : integer | Returns the number of weeks in the given year (52 or 53). |
Method | Description | |
---|---|---|
_correct ( integer $mask = self::MASK_ALLPARTS, integer $down = false ) | Corrects any over- or underflows in any of the date's members. | |
_correctMonth ( ) | Corrects the current month. | |
_initializeFromArgs ( $args ) | Handles args in order: year month day hour min sec tz | |
_initializeFromArray ( $date ) | ||
_initializeFromObject ( $date ) | ||
_initializeTimezone ( $timezone ) | ||
_regexCallback ( $reg ) : string | Callback used to replace a strtime pattern | |
_strftime ( $format ) : string | Formats date and time using a limited set of the strftime() format. |
public __construct ( $date = null, $timezone = null ) |
public __toString ( ) : string | ||
return | string | This object converted to a string. |
protected _correctMonth ( ) |
protected _initializeFromArgs ( $args ) |
protected _regexCallback ( $reg ) : string | ||
return | string | Replacement string. |
public add ( $factor ) |
public compareDate ( mixed $other ) : integer | ||
$other | mixed | The date to compare to. |
return | integer | == 0 if they are on the same date >= 1 if $this is greater (later) <= -1 if $other is greater (later) |
public compareDateTime ( mixed $other ) : integer | ||
$other | mixed | The date to compare to. |
return | integer | == 0 if they are equal >= 1 if $this is greater (later) <= -1 if $other is greater (later) |
public compareTime ( mixed $other ) : integer | ||
$other | mixed | The date to compare to. |
return | integer | == 0 if they are at the same time >= 1 if $this is greater (later) <= -1 if $other is greater (later) |
public dateString ( ) : string | ||
return | string | Date and time. |
public static getTimezoneAlias ( string $timezone ) : string | ||
$timezone | string | Some timezone alias. |
return | string | The Olson timezone name, or the original value, if no alias found. |
public setDefaultFormat ( string $format ) | ||
$format | string |
public setNthWeekday ( integer $weekday, integer $nth = 1 ) | ||
$weekday | integer | The day of the week (0 = Sunday, etc). |
$nth | integer | The $nth $weekday to set to (defaults to 1). Negative values count from end of the month (@since Horde_Date 2.1.0). |
public setTimezone ( string $timezone ) : Horde_Date | ||
$timezone | string | The new timezone. |
return | Horde_Date | This object. |
public sub ( $factor ) |
public toDateTime ( ) : DateTime | ||
return | DateTime |
public toiCalendar ( boolean $floating = false ) : string | ||
$floating | boolean | Whether to return a floating date-time (without time zone information). |
return | string | Date and time. |
public weekOfMonth ( ) : integer | ||
return | integer | The week number. |
public weekOfYear ( ) : integer | ||
return | integer | The week number. |
public static weeksInYear ( integer $year ) : integer | ||
$year | integer | The year to count the number of weeks in. |
return | integer | $numWeeks The number of weeks in $year. |
protected static array $_corrections | ||
return | array |
protected string $_defaultFormat | ||
return | string |
protected static string $_defaultSpecs | ||
return | string |
protected static string $_supportedSpecs | ||
return | string |
protected string $_timezone | ||
return | string |
protected static array $_timezoneAbbreviations | ||
return | array |
protected static array $_timezoneAliases | ||
return | array |
protected static array $_timezoneIdentifiers | ||
return | array |