Class: Date_Calc
Source Location: /Date-1.5.0a4/Date/Calc.php
Calculates, manipulates and retrieves dates
Author(s):
Version:
Copyright:
- 1999-2007 Monte Ohrt, Pierre-Alain Joye, Daniel Convissor, C.A. Woodcock
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Method Detail
addDays [line 1553]
string addDays(
int
$pn_days, int
$pn_day, int
$pn_month, int
$pn_year, [string
$ps_format = DATE_CALC_FORMAT])
|
|
Returns the date the specified no of days from the given date To subtract days use a negative value for the '$pn_days' parameter
Parameters:
addHours [line 694]
array addHours(
int
$pn_hours, int
$pn_day, int
$pn_month, int
$pn_year, int
$pn_hour)
|
|
Returns the date the specified no of hours from the given date To subtract hours use a negative value for the '$pn_hours' parameter
Parameters:
addMinutes [line 751]
array addMinutes(
int
$pn_minutes, int
$pn_day, int
$pn_month, int
$pn_year, int
$pn_hour, int
$pn_minute)
|
|
Returns the date the specified no of minutes from the given date To subtract minutes use a negative value for the '$pn_minutes' parameter
Parameters:
addMonths [line 1384]
string addMonths(
int
$pn_months, int
$pn_day, int
$pn_month, int
$pn_year, [string
$ps_format = DATE_CALC_FORMAT])
|
|
Returns the date the specified no of months from the given date To subtract months use a negative value for the '$pn_months' parameter
Parameters:
addMonthsToDays [line 1323]
int addMonthsToDays(
int
$pn_months, int
$pn_days)
|
|
Returns 'Julian Day' of the date the specified no of months from the given date To subtract months use a negative value for the '$pn_months' parameter
Parameters:
addSeconds [line 822]
array addSeconds(
mixed
$pn_seconds, int
$pn_day, int
$pn_month, int
$pn_year, int
$pn_hour, int
$pn_minute, mixed
$pn_second, [bool
$pb_countleap = DATE_COUNT_LEAP_SECONDS])
|
|
Returns the date the specified no of seconds from the given date If leap seconds are specified to be counted, the passed time must be UTC. To subtract seconds use a negative value for the '$pn_seconds' parameter. N.B. the return type of the second part of the date is float if either '$pn_seconds' or '$pn_second' is a float; otherwise, it is integer.
Parameters:
addYears [line 1503]
string addYears(
int
$pn_years, int
$pn_day, int
$pn_month, int
$pn_year, [string
$ps_format = DATE_CALC_FORMAT])
|
|
Returns the date the specified no of years from the given date To subtract years use a negative value for the '$pn_years' parameter
Parameters:
addYearsToDays [line 1433]
int addYearsToDays(
int
$pn_years, int
$pn_days)
|
|
Returns 'Julian Day' of the date the specified no of years from the given date To subtract years use a negative value for the '$pn_years' parameter
Parameters:
beginOfMonth [line 3447]
string beginOfMonth(
[int
$month = 0], [int
$year = null], [string
$format = DATE_CALC_FORMAT])
|
|
Return date of first day of month of given date
Parameters:
beginOfMonthBySpan [line 3668]
string beginOfMonthBySpan(
[int
$months = 0], [string
$month = 0], [string
$year = null], [string
$format = DATE_CALC_FORMAT])
|
|
Returns date of the first day of the month in the number of months from the given date
Parameters:
beginOfNextMonth [line 3589]
string beginOfNextMonth(
[mixed
$dummy = null], [int
$month = 0], [int
$year = null], [string
$format = DATE_CALC_FORMAT])
|
|
Returns date of begin of next month of given date
Parameters:
beginOfNextWeek [line 3404]
string beginOfNextWeek(
[int
$day = 0], [int
$month = 0], [int
$year = null], [string
$format = DATE_CALC_FORMAT])
|
|
Find the month day of the beginning of week after given date, using DATE_CALC_BEGIN_WEEKDAYCan return weekday of prev month.
Parameters:
beginOfPrevMonth [line 3514]
string beginOfPrevMonth(
[mixed
$dummy = null], [int
$month = 0], [int
$year = null], [string
$format = DATE_CALC_FORMAT])
|
|
Returns date of the first day of previous month of given date
Parameters:
beginOfPrevWeek [line 3360]
string beginOfPrevWeek(
[int
$day = 0], [int
$month = 0], [int
$year = null], [string
$format = DATE_CALC_FORMAT])
|
|
Find the month day of the beginning of week before given date, using DATE_CALC_BEGIN_WEEKDAYCan return weekday of prev month.
Parameters:
beginOfWeek [line 3282]
string beginOfWeek(
[int
$day = 0], [int
$month = 0], [int
$year = null], [string
$format = DATE_CALC_FORMAT])
|
|
Find the month day of the beginning of week for given date, using DATE_CALC_BEGIN_WEEKDAYCan return weekday of prev month.
Parameters:
compareDates [line 4069]
int compareDates(
int
$day1, int
$month1, int
$year1, int
$day2, int
$month2, int
$year2)
|
|
Compares two dates
Parameters:
dateDiff [line 4036]
int dateDiff(
int
$day1, int
$month1, int
$year1, int
$day2, int
$month2, int
$year2)
|
|
Returns number of days between two given dates
Parameters:
dateFormat [line 162]
string dateFormat(
int
$day, int
$month, int
$year, string
$format)
|
|
Formats the date in the given format, much like strftime()This function is used to alleviate the problem with 32-bit numbers for dates pre 1970 or post 2038, as strftime() has on most systems. Most of the formatting options are compatible. Formatting options: - %a - abbreviated weekday name (Sun, Mon, Tue)
- %A - full weekday name (Sunday, Monday, Tuesday)
- %b - abbreviated month name (Jan, Feb, Mar)
- %B - full month name (January, February, March)
- %d - day of month (range 00 to 31)
- %e - day of month, single digit (range 0 to 31)
- %E - number of days since unspecified epoch (integer).
('%E' is useful for passing a date in a URL as an
integer value. Then simply use Date_Calc::daysToDate()
to convert back to a date.)
- %j - day of year (range 001 to 366)
- %m - month as decimal number (range 1 to 12)
- %n - newline character (\n)
- %t - tab character (\t)
- %w - weekday as decimal (0 = Sunday)
- %U - week number of current year, first sunday as first week
- %y - year as decimal (range 00 to 99)
- %Y - year as decimal including century (range 0000 to 9999)
- %% - literal '%'
Parameters:
dateNow [line 259]
string dateNow(
[string
$format = DATE_CALC_FORMAT])
|
|
Returns the current local date NOTE: This function retrieves the local date using strftime(), which may or may not be 32-bit safe on your system.
Parameters:
dateSeason [line 2115]
float dateSeason(
string
$season, [string
$year = 0])
|
|
Determines julian date of the given season
Parameters:
dateToDays [line 1109]
int dateToDays(
int
$day, int
$month, int
$year)
|
|
Converts a date in the proleptic Gregorian calendar to the no of days since 24th November, 4714 B.C. Returns the no of days since Monday, 24th November, 4714 B.C. in the proleptic Gregorian calendar (which is 24th November, -4713 using 'Astronomical' year numbering, and 1st January, 4713 B.C. in the proleptic Julian calendar). This is also the first day of the 'Julian Period' proposed by Joseph Scaliger in 1583, and the number of days since this date is known as the 'Julian Day'. (It is not directly to do with the Julian calendar, although this is where the name is derived from.) The algorithm is valid for all years (positive and negative), and also for years preceding 4714 B.C.
Parameters:
dateToDaysJulian [line 1759]
int dateToDaysJulian(
int
$day, int
$month, int
$year)
|
|
Converts a date in the proleptic Julian calendar to the no of days since 1st January, 4713 B.C. Returns the no of days since Monday, 1st January, 4713 B.C. in the proleptic Julian calendar (which is 1st January, -4712 using 'Astronomical' year numbering, and 24th November, 4713 B.C. in the proleptic Gregorian calendar). This is also the first day of the 'Julian Period' proposed by Joseph Scaliger in 1583, and the number of days since this date is known as the 'Julian Day'. (It is not directly to do with the Julian calendar, although this is where the name is derived from.) The algorithm is valid for all years (positive and negative), and also for years preceding 4713 B.C.
Parameters:
dayOfWeek [line 2434]
int dayOfWeek(
[int
$day = null], [int
$month = null], [int
$year = null])
|
|
Returns day of week for given date (0 = Sunday) The algorithm is valid for all years (positive and negative).
Parameters:
dayOfYear [line 2173]
int dayOfYear(
[int
$pn_day = 0], [int
$pn_month = 0], [int
$pn_year = null])
|
|
Returns number of days since 31 December of year before given date
Parameters:
daysInMonth [line 2676]
int daysInMonth(
[int
$month = 0], [int
$year = null])
|
|
Returns the number of days in the given month
Parameters:
daysInYear [line 2704]
int daysInYear(
[int
$year = null])
|
|
Returns the number of days in the given year
Parameters:
daysToDate [line 1168]
string daysToDate(
int
$days, [string
$format = DATE_CALC_FORMAT])
|
|
Converts no 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 Returned date belongs to the proleptic Gregorian calendar, using 'Astronomical' year numbering. The algorithm is valid for all years (positive and negative), and also for years preceding 4714 B.C. (i.e. for negative 'Julian Days'), and so the only limitation is platform-dependent (for 32-bit systems the maximum year would be something like about 1,465,190 A.D.). N.B. Monday, 24th November, 4714 B.C. is Julian Day '0'.
Parameters:
daysToDateJulian [line 1808]
string daysToDateJulian(
int
$days, [string
$format = DATE_CALC_FORMAT])
|
|
Converts no of days since 1st January, 4713 B.C. (in the proleptic Julian calendar, which is year -4712 using 'Astronomical' year numbering) to Julian calendar date Returned date belongs to the proleptic Julian calendar, using 'Astronomical' year numbering.
Parameters:
daysToDayOfWeek [line 2408]
int daysToDayOfWeek(
int
$pn_days)
|
|
Returns day of week for specified 'Julian Day' The algorithm is valid for all years (positive and negative), and also for years preceding 4714 B.C. (i.e. for negative 'Julian Days'), and so the only limitation is platform-dependent (for 32-bit systems the maximum year would be something like about 1,465,190 A.D.). N.B. Monday, 24th November, 4714 B.C. is Julian Day '0'.
Parameters:
daysToNextDayOfWeek [line 3137]
int daysToNextDayOfWeek(
int
$dow, int
$days, [bool
$onorafter = false])
|
|
Returns 'Julian Day' of the next specific day of the week from the given date.
Parameters:
daysToPrevDayOfWeek [line 3059]
int daysToPrevDayOfWeek(
int
$dow, int
$days, [bool
$onorbefore = false])
|
|
Returns 'Julian Day' of the previous specific day of the week from the given date.
Parameters:
defaultCentury [line 339]
int defaultCentury(
int
$year)
|
|
Turns a two digit year into a four digit year Return value depends on current year; the century chosen will be the one which forms the year that is closest to the current year. If the two possibilities are equidistant to the current year (i.e. 50 years in the past and 50 years in the future), then the past year is chosen. For example, if the current year is 2007: - "03" - returns 2003
- "09" - returns 2009
- "56" - returns 2056 (closer to 2007 than 1956)
- "57" - returns 1957 (1957 and 2007 are equidistant,
so previous century chosen)
- "58" - returns 1958
Parameters:
endOfMonth [line 3482]
string endOfMonth(
[int
$month = 0], [int
$year = null], [string
$format = DATE_CALC_FORMAT])
|
|
Return date of last day of month of given date
Parameters:
endOfMonthBySpan [line 3709]
string endOfMonthBySpan(
[int
$months = 0], [string
$month = 0], [string
$year = null], [string
$format = DATE_CALC_FORMAT])
|
|
Returns date of the last day of the month in the number of months from the given date
Parameters:
endOfNextMonth [line 3628]
string endOfNextMonth(
[mixed
$dummy = null], [int
$month = 0], [int
$year = null], [string
$format = DATE_CALC_FORMAT])
|
|
Returns date of the last day of next month of given date
Parameters:
endOfPrevMonth [line 3553]
string endOfPrevMonth(
[mixed
$dummy = null], [int
$month = 0], [int
$year = null], [string
$format = DATE_CALC_FORMAT])
|
|
Returns date of the last day of previous month for given date
Parameters:
endOfWeek [line 3321]
string endOfWeek(
[int
$day = 0], [int
$month = 0], [int
$year = null], [string
$format = DATE_CALC_FORMAT])
|
|
Find the month day of the end of week for given date, using DATE_CALC_BEGIN_WEEKDAYCan return weekday of following month.
Parameters:
firstDayOfMonth [line 1638]
integer firstDayOfMonth(
int
$pn_month, int
$pn_year)
|
|
Returns the Julian Day of the first day of the month of the specified year (i.e. the no of days since 24th November, 4714 B.C.)
Parameters:
firstDayOfYear [line 1704]
integer firstDayOfYear(
int
$pn_year)
|
|
Returns the Julian Day of the first day of the year (i.e. the no of days since 24th November, 4714 B.C.)
Parameters:
firstOfMonthWeekday [line 3741]
int firstOfMonthWeekday(
[int
$month = 0], [int
$year = null])
|
|
Find the day of the week for the first of the month of given date
Parameters:
getCalendarMonth [line 2815]
array getCalendarMonth(
[int
$month = 0], [int
$year = null], [string
$format = DATE_CALC_FORMAT])
|
|
Return a set of arrays to construct a calendar month for the given date
Parameters:
getCalendarWeek [line 2773]
array getCalendarWeek(
[int
$day = 0], [int
$month = 0], [int
$year = null], [string
$format = DATE_CALC_FORMAT])
|
|
Return an array with days in week
Parameters:
getCalendarYear [line 2870]
array getCalendarYear(
[int
$year = null], [string
$format = DATE_CALC_FORMAT])
|
|
Return a set of arrays to construct a calendar year for the given date
Parameters:
getDay [line 307]
Returns the current local day in format DD
getFirstDayOfMonth [line 1597]
int getFirstDayOfMonth(
int
$pn_month, int
$pn_year)
|
|
Returns first day of the specified month of specified year as integer
Parameters:
getFirstMonthOfYear [line 1683]
int getFirstMonthOfYear(
int
$pn_year)
|
|
Returns first month of specified year as integer
Parameters:
getLastDayOfMonth [line 1617]
int getLastDayOfMonth(
int
$pn_month, int
$pn_year)
|
|
Returns last day of the specified month of specified year as integer
Parameters:
getMonth [line 291]
Returns the current local month in format MM
getMonthAbbrname [line 2322]
string getMonthAbbrname(
int
$month, [int
$length = 3])
|
|
Returns the abbreviated month name for the given month
Parameters:
getMonthFromFullName [line 2349]
int getMonthFromFullName(
string
$month)
|
|
Returns the numeric month from the month name or an abreviation Both August and Aug would return 8.
Parameters:
getMonthFullname [line 2296]
string getMonthFullname(
int
$month)
|
|
Returns the full month name for the given month
Parameters:
getMonthNames [line 1238]
array getMonthNames(
[int
$pb_abbreviated = false])
|
|
Returns an array of month names Used to take advantage of the setlocale function to return language specific month names. TODO: cache values to some global array to avoid performance hits when called more than once.
Parameters:
getMonths [line 1210]
array getMonths(
int
$pn_year)
|
|
Returns array of the month numbers, in order, for the given year
Parameters:
getSecondsInDay [line 486]
int getSecondsInDay(
int
$pn_day, int
$pn_month, int
$pn_year)
|
|
Returns the total number of seconds in the day of the given date This takes into account leap seconds.
Parameters:
getSecondsInHour [line 561]
int getSecondsInHour(
int
$pn_day, int
$pn_month, int
$pn_year, int
$pn_hour)
|
|
Returns the total number of seconds in the hour of the given date This takes into account leap seconds.
Parameters:
getSecondsInMinute [line 590]
int getSecondsInMinute(
int
$pn_day, int
$pn_month, int
$pn_year, int
$pn_hour, int
$pn_minute)
|
|
Returns the total number of seconds in the minute of the given hour This takes into account leap seconds.
Parameters:
getSecondsInMonth [line 427]
int getSecondsInMonth(
int
$pn_month, int
$pn_year)
|
|
Returns the total number of seconds in the given month This takes into account leap seconds.
Parameters:
getSecondsInYear [line 371]
int getSecondsInYear(
int
$pn_year)
|
|
Returns the total number of seconds in the given year This takes into account leap seconds.
Parameters:
getWeekdayAbbrname [line 2263]
string getWeekdayAbbrname(
[int
$pn_day = 0], [int
$pn_month = 0], [int
$pn_year = null], [int
$length = 3])
|
|
Returns the abbreviated weekday name for the given date
Parameters:
getWeekdayFullname [line 2228]
string getWeekdayFullname(
[int
$pn_day = 0], [int
$pn_month = 0], [int
$pn_year = null])
|
|
Returns the full weekday name for the given date
Parameters:
getWeekDays [line 2378]
array getWeekDays(
[int
$pb_abbreviated = false])
|
|
Returns an array of week day names Used to take advantage of the setlocale function to return language specific week days.
Parameters:
getYear [line 275]
Returns the current local year in format CCYY
gregorianToISO [line 1940]
string gregorianToISO(
int
$day, int
$month, int
$year)
|
|
Converts from Gregorian Year-Month-Day to ISO Year-WeekNumber-WeekDay Uses ISO 8601 definitions.
Parameters:
isFutureDate [line 3959]
bool isFutureDate(
int
$day, int
$month, int
$year)
|
|
Determines if given date is a future date from now
Parameters:
isLeapYear [line 3929]
boolean isLeapYear(
[int
$year = null])
|
|
Returns true for a leap year, else false
Parameters:
isLeapYearGregorian [line 3878]
bool isLeapYearGregorian(
[int
$year = null])
|
|
Returns true for a leap year, else false Uses the proleptic Gregorian calendar. The year 0 (1 B.C.) is assumed in this algorithm to be a leap year. The function is valid for all years, positive and negative.
Parameters:
isLeapYearJulian [line 3907]
boolean isLeapYearJulian(
[int
$year = null])
|
|
Returns true for a leap year, else false Uses the proleptic Julian calendar. The year 0 (1 B.C.) is assumed in this algorithm to be a leap year. The function is valid for all years, positive and negative.
Parameters:
isoWeekDate [line 1858]
array isoWeekDate(
[int
$pn_day = 0], [int
$pn_month = 0], [int
$pn_year = null])
|
|
Returns array defining the 'ISO Week Date' as defined in ISO 8601 Expects a date in the proleptic Gregorian calendar using 'Astronomical' year numbering, that is, with a year 0. Algorithm is valid for all years (positive and negative). N.B. the ISO week day no for Sunday is defined as 7, whereas this class and its related functions defines Sunday as 0.
Parameters:
isoWeekToDate [line 4396]
string isoWeekToDate(
int
$dow, int
$week, int
$year, [string
$format = DATE_CALC_FORMAT])
|
|
Converts the Week number and Day-of-Week to Date Calculation algorithm taken from http://www.merlyn.demon.co.uk/weekcalc.htm.
Parameters:
isPastDate [line 3995]
boolean isPastDate(
int
$day, int
$month, int
$year)
|
|
Determines if given date is a past date from now
Parameters:
isValidDate [line 3842]
bool isValidDate(
int
$day, int
$month, int
$year)
|
|
Returns true for valid date, false for invalid date Uses the proleptic Gregorian calendar, with the year 0 (1 B.C.) assumed to be valid and also assumed to be a leap year.
Parameters:
julianDate [line 2207]
int julianDate(
[int
$pn_day = 0], [int
$pn_month = 0], [int
$pn_year = null])
|
|
Returns number of days since 31 December of year before given date
Parameters:
lastDayOfMonth [line 1662]
integer lastDayOfMonth(
int
$pn_month, int
$pn_year)
|
|
Returns the Julian Day of the last day of the month of the specified year (i.e. the no of days since 24th November, 4714 B.C.)
Parameters:
lastDayOfYear [line 1725]
integer lastDayOfYear(
int
$pn_year)
|
|
Returns the Julian Day of the last day of the year (i.e. the no of days since 24th November, 4714 B.C.)
Parameters:
nextDay [line 2937]
string nextDay(
[int
$day = 0], [int
$month = 0], [int
$year = null], [string
$format = DATE_CALC_FORMAT])
|
|
Returns date of day after given date
Parameters:
nextDayOfWeek [line 3174]
string nextDayOfWeek(
int
$dow, [int
$day = 0], [int
$month = 0], [int
$year = null], [string
$format = DATE_CALC_FORMAT], [bool
$onorafter = false])
|
|
Returns date of the next specific day of the week from the given date
Parameters:
nextDayOfWeekOnOrAfter [line 3248]
string nextDayOfWeekOnOrAfter(
int
$dow, [int
$day = 0], [int
$month = 0], [int
$year = null], [string
$format = DATE_CALC_FORMAT])
|
|
Returns date of the next specific day of the week on or after the given date
Parameters:
nextMonth [line 1290]
array nextMonth(
int
$pn_month, int
$pn_year)
|
|
Returns month and year of next month
Parameters:
nextWeekday [line 3015]
string nextWeekday(
[int
$day = 0], [int
$month = 0], [int
$year = null], [string
$format = DATE_CALC_FORMAT])
|
|
Returns date of the next weekday of given date, skipping from Friday to Monday
Parameters:
nWeekDayOfMonth [line 3773]
string nWeekDayOfMonth(
int
$week, int
$dow, int
$month, int
$year, [string
$format = DATE_CALC_FORMAT])
|
|
Calculates the date of the Nth weekday of the month, such as the second Saturday of January 2000
Parameters:
prevDay [line 2904]
string prevDay(
[int
$day = 0], [int
$month = 0], [int
$year = null], [string
$format = DATE_CALC_FORMAT])
|
|
Returns date of day before given date
Parameters:
prevDayOfWeek [line 3096]
string prevDayOfWeek(
int
$dow, [int
$day = 0], [int
$month = 0], [int
$year = null], [string
$format = DATE_CALC_FORMAT], [bool
$onorbefore = false])
|
|
Returns date of the previous specific day of the week from the given date
Parameters:
prevDayOfWeekOnOrBefore [line 3215]
string prevDayOfWeekOnOrBefore(
int
$dow, [int
$day = 0], [int
$month = 0], [int
$year = null], [string
$format = DATE_CALC_FORMAT])
|
|
Returns date of the previous specific day of the week on or before the given date
Parameters:
prevMonth [line 1263]
array prevMonth(
int
$pn_month, int
$pn_year)
|
|
Returns month and year of previous month
Parameters:
prevWeekday [line 2972]
string prevWeekday(
[int
$day = 0], [int
$month = 0], [int
$year = null], [string
$format = DATE_CALC_FORMAT])
|
|
Returns date of the previous weekday, skipping from Monday to Friday
Parameters:
quarterOfYear [line 2653]
int quarterOfYear(
[int
$day = 0], [int
$month = 0], [int
$year = null])
|
|
Returns quarter of the year for given date
Parameters:
round [line 4134]
array round(
int
$pn_precision, int
$pn_day, int
$pn_month, int
$pn_year, [int
$pn_hour = 0], [int
$pn_minute = 0], [mixed
$pn_second = 0], [bool
$pb_countleap = DATE_COUNT_LEAP_SECONDS])
|
|
Rounds the date according to the specified precision The precision parameter must be one of the following constants: The precision can also be specified as an integral offset from one of these constants, where the offset reflects a precision of 10 to the power of the offset greater than the constant. For example: - (DATE_PRECISION_YEAR - 1) rounds the date to the nearest 10
years
- (DATE_PRECISION_YEAR - 3) rounds the date to the nearest 1000
years
- (DATE_PRECISION_SECOND + 1) rounds the date to 1 decimal
point of a second
- (DATE_PRECISION_SECOND + 1) rounds the date to 3 decimal
points of a second
- (DATE_PRECISION_SECOND + 1) rounds the date to the nearest 10
seconds (thus it is equivalent to
DATE_PRECISION_10SECONDS)
N.B. This function requires a time in UTC if both the precision is at least DATE_PRECISION_SECOND and leap seconds are being counted, otherwise any local time is acceptable.
Parameters:
roundSeconds [line 4358]
array roundSeconds(
int
$pn_precision, int
$pn_day, int
$pn_month, int
$pn_year, int
$pn_hour, int
$pn_minute, mixed
$pn_second, [bool
$pb_countleap = DATE_COUNT_LEAP_SECONDS])
|
|
Rounds seconds up or down to the nearest specified unit
Parameters:
secondsPastMidnight [line 619]
mixed secondsPastMidnight(
int
$pn_hour, int
$pn_minute, mixed
$pn_second)
|
|
Returns the no of seconds since midnight (0-86399)
Parameters:
secondsPastMidnightToTime [line 639]
mixed secondsPastMidnightToTime(
mixed
$pn_seconds)
|
|
Returns the time as an array (i.e. hour, minute, second)
Parameters:
secondsPastTheHour [line 669]
mixed secondsPastTheHour(
int
$pn_minute, mixed
$pn_second)
|
|
Returns the no of seconds since the last hour o'clock (0-3599)
Parameters:
weekOfMonth [line 2632]
int weekOfMonth(
[int
$pn_day = 0])
|
|
Alias for 'weekOfMonthAbsolute()'
Parameters:
weekOfMonthAbsolute [line 2610]
int weekOfMonthAbsolute(
[int
$pn_day = 0])
|
|
Returns week of the month counting week 1 as 1st-7th of the month, regardless of what day the 1st falls on Returned value is an integer from 1 to 5. Week 5 will start on the 29th of the month and have between 1 and 3 days, except in February in a non-leap year, when there will be 4 weeks only.
Parameters:
weekOfYear [line 2585]
int weekOfYear(
[int
$pn_day = 0], [int
$pn_month = 0], [int
$pn_year = null])
|
|
Returns week of the year, where first Sunday is first day of first week N.B. this function is equivalent to calling:
Returned week is an integer from 1 to 53.
Parameters:
weekOfYear1st [line 2541]
int weekOfYear1st(
[int
$pn_day = 0], [int
$pn_month = 0], [int
$pn_year = null], [int
$pn_firstdayofweek = DATE_CALC_BEGIN_WEEKDAY])
|
|
Returns week of the year counting week 1 as the week that contains 1st January Week 1 is determined to be the week that includes the 1st January, even if this week extends into the previous year, in which case the week will only contain between 1 and 6 days of the current year. Note that this definition depends on which day is the first day of the week, and that if this is not passed as the '$pn_firstdayofweek' parameter, the default is assumed. Note also that the last day week of the year is also likely to contain less than seven days, except in the case that the last day of the week falls on 31st December. Returned value is an integer from 1 to 54. The year will only contain 54 weeks in the case of a leap year in which 1st January is the last day of the week, and 31st December is the first day of the week. In this case, both weeks 1 and 54 will contain one day only.
Parameters:
weekOfYear4th [line 1993]
array weekOfYear4th(
[int
$pn_day = 0], [int
$pn_month = 0], [int
$pn_year = null], [int
$pn_firstdayofweek = DATE_CALC_BEGIN_WEEKDAY])
|
|
Returns week of the year counting week 1 as the week that contains 4th January Week 1 is determined to be the week that includes the 4th January, and therefore can be defined as the first week of the year that has at least 4 days. The previous week is counted as week 52 or 53 of the previous year. Note that this definition depends on which day is the first day of the week, and that if this is not passed as the '$pn_firstdayofweek' parameter, the default is assumed. Note also that the last day week of the year is likely to extend into the following year, except in the case that the last day of the week falls on 31st December. Also note that this is very similar to the ISO week returned by Date::isoWeekDate(), the difference being that the ISO week always has 7 days, and if the 4th of January is a Friday, for example, ISO week 1 would start on Monday, 31st December in the previous year, whereas the week defined by this function would start on 1st January, but would be only 6 days long. Of course you can also set the day of the week, whereas the ISO week starts on a Monday by definition. Returned week is an integer from 1 to 53.
Parameters:
weekOfYear7th [line 2067]
array weekOfYear7th(
[int
$pn_day = 0], [int
$pn_month = 0], [int
$pn_year = null], [int
$pn_firstdayofweek = DATE_CALC_BEGIN_WEEKDAY])
|
|
Returns week of the year counting week 1 as the week that contains 7th January Week 1 is determined to be the week that includes the 7th January, and therefore can be defined as the first full week of the year. The previous week is counted as week 52 or 53 of the previous year. Note that this definition depends on which day is the first day of the week, and that if this is not passed as the '$pn_firstdayofweek' parameter, the default is assumed. Note also that the last day week of the year is likely to extend into the following year, except in the case that the last day of the week falls on 31st December. Returned week is an integer from 1 to 53.
Parameters:
weekOfYearAbsolute [line 2488]
int weekOfYearAbsolute(
[int
$pn_day = 0], [int
$pn_month = 0], [int
$pn_year = null])
|
|
Returns week of the year counting week 1 as 1st-7th January, regardless of what day 1st January falls on Returned value is an integer from 1 to 53. Week 53 will start on 31st December and have only one day, except in a leap year, in which it will start a day earlier and contain two days.
Parameters:
weeksInMonth [line 2732]
int weeksInMonth(
[int
$month = 0], [int
$year = null])
|
|
Returns the number of rows on a calendar month Useful for determining the number of rows when displaying a typical month calendar.
Parameters:
Documentation generated on Mon, 11 Mar 2019 15:55:00 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|