Class Horde_Date_Utils
Horde Date wrapper/logic class, including some calculation
functions.
Methods summary
public static
boolean
|
#
isLeapYear( integer $year )
Returns whether a year is a leap year.
Returns whether a year is a leap year.
Parameters
Returns
boolean True if the year is a leap year.
|
public static
Horde_Date
|
#
firstDayOfWeek( integer $week, integer $year )
Returns the date of the year that corresponds to the first day of the
given week.
Returns the date of the year that corresponds to the first day of the
given week.
Parameters
- $week
- The week of the year to find the first day of.
- $year
- The year to calculate for.
Returns
Horde_Date
The date of the first day of the given week.
|
public static
integer
|
#
daysInMonth( integer $month, integer $year )
Returns the number of days in the specified month.
Returns the number of days in the specified month.
Parameters
- $month
- The month
- $year
- The year.
Returns
integer The number of days in the month.
|
public static
string
|
#
relativeDateTime( mixed $time, string $date_format = '%x', string $time_format = '%X' )
Returns a relative, natural language representation of a timestamp
Returns a relative, natural language representation of a timestamp
Parameters
- $time
- The time. Any format accepted by Horde_Date.
- $date_format
- <p>Format to display date if timestamp is
more then 1 day old.</p>
- $time_format
- <p>Format to display time if timestamp is 1
day old.</p>
Returns
string The relative time (i.e. 2 minutes ago)
|
public static
string
|
#
strftime2date( string $format )
Tries to convert strftime() formatters to date() formatters.
Tries to convert strftime() formatters to date() formatters.
Unsupported formatters will be removed.
Parameters
- $format
- A strftime() formatting string.
Returns
string A date() formatting string.
|