Class: Date_Calc
Source Location: /Date-1.5.0a1/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 1545]
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 686]
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 743]
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 1376]
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 1315]
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 814]
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 1495]
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 1425]
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 3441]
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 3662]
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 3583]
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 3398]
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_WEEKDAY Can return weekday of prev month.
Parameters:
beginOfPrevMonth [line 3508]
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 3354]
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_WEEKDAY Can return weekday of prev month.
Parameters:
beginOfWeek [line 3276]
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_WEEKDAY Can return weekday of prev month.
Parameters:
compareDates [line 4041]
int compareDates(
int
$day1, int
$month1, int
$year1, int
$day2, int
$month2, int
$year2)
|
|
Compares two dates
Parameters:
dateDiff [line 4008]
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 155]
string dateFormat(
int
$day, int
$month, int
$year, string
$format)
|
|
Formats the date in the given format, much like strfmt() This function is used to alleviate the problem with 32-bit numbers for dates pre 1970 or post 2038, as strfmt() 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
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 251]
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 2109]
float dateSeason(
string
$season, [string
$year = 0])
|
|
Determines julian date of the given season Adapted from previous work in Java by James Mark Hamilton.
Parameters:
dateToDays [line 1101]
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 1751]
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 2428]
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 2167]
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 2670]
int daysInMonth(
[int
$month = 0], [int
$year = null])
|
|
Returns the number of days in the given month
Parameters:
daysInYear [line 2698]
int daysInYear(
[int
$year = null])
|
|
Returns the number of days in the given year
Parameters:
daysToDate [line 1160]
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 1800]
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 2402]
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 3131]
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 3053]
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 331]
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 3476]
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 3703]
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 3622]
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 3547]
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 3315]
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_WEEKDAY Can return weekday of following month.
Parameters:
firstDayOfMonth [line 1630]
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 1696]
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 3735]
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 2809]
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 2767]
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 2864]
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 299]
Returns the current local day in format DD
getFirstDayOfMonth [line 1589]
int getFirstDayOfMonth(
int
$pn_month, int
$pn_year)
|
|
Returns first day of the specified month of specified year as integer
Parameters:
getFirstMonthOfYear [line 1675]
int getFirstMonthOfYear(
int
$pn_year)
|
|
Returns first month of specified year as integer
Parameters:
getLastDayOfMonth [line 1609]
int getLastDayOfMonth(
int
$pn_month, int
$pn_year)
|
|
Returns last day of the specified month of specified year as integer
Parameters:
getMonth [line 283]
Returns the current local month in format MM
getMonthAbbrname [line 2316]
string getMonthAbbrname(
int
$month, [int
$length = 3])
|
|
Returns the abbreviated month name for the given month
Parameters:
getMonthFromFullName [line 2343]
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 2290]
string getMonthFullname(
int
$month)
|
|
Returns the full month name for the given month
Parameters:
getMonthNames [line 1230]
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 1202]
array getMonths(
int
$pn_year)
|
|
Returns array of the month numbers, in order, for the given year
Parameters:
getSecondsInDay [line 478]
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 553]
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 582]
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 419]
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 363]
int getSecondsInYear(
int
$pn_year)
|
|
Returns the total number of seconds in the given year This takes into account leap seconds.
Parameters:
getWeekdayAbbrname [line 2257]
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 2222]
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 2372]
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 267]
Returns the current local year in format CCYY
gregorianToISO [line 1932]
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 3931]
bool isFutureDate(
int
$day, int
$month, int
$year)
|
|
Determines if given date is a future date from now
Parameters:
isLeapYear [line 3901]
boolean isLeapYear(
[int
$year = null])
|
|
Returns true for a leap year, else false
Parameters:
isLeapYearGregorian [line 3850]
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 3879]
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 1850]
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:
isPastDate [line 3967]
boolean isPastDate(
int
$day, int
$month, int
$year)
|
|
Determines if given date is a past date from now
Parameters:
isValidDate [line 3814]
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 2201]
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 1654]
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 1717]
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 2931]
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 3168]
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 3242]
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 1282]
array nextMonth(
int
$pn_month, int
$pn_year)
|
|
Returns month and year of next month
Parameters:
nextWeekday [line 3009]
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 3767]
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 2898]
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 3090]
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 3209]
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 1255]
array prevMonth(
int
$pn_month, int
$pn_year)
|
|
Returns month and year of previous month
Parameters:
prevWeekday [line 2966]
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 2647]
int quarterOfYear(
[int
$day = 0], [int
$month = 0], [int
$year = null])
|
|
Returns quarter of the year for given date
Parameters:
round [line 4105]
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:
rounds the date to the nearest 10 years
rounds the date to the nearest 1000 years
rounds the date to 1 decimal point of a second
rounds the date to 3 decimal points of a second
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 4329]
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 611]
mixed secondsPastMidnight(
int
$pn_hour, int
$pn_minute, mixed
$pn_second)
|
|
Returns the no of seconds since midnight (0-86399)
Parameters:
secondsPastMidnightToTime [line 631]
mixed secondsPastMidnightToTime(
mixed
$pn_seconds)
|
|
Returns the time as an array (i.e. hour, minute, second)
Parameters:
secondsPastTheHour [line 661]
mixed secondsPastTheHour(
int
$pn_minute, mixed
$pn_second)
|
|
Returns the no of seconds since the last hour o'clock (0-3599)
Parameters:
weekOfMonth [line 2626]
int weekOfMonth(
[int
$pn_day = 0])
|
|
Alias for 'weekOfMonthAbsolute()'
Parameters:
weekOfMonthAbsolute [line 2604]
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 2579]
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 2535]
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 1985]
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 '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 2059]
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 2482]
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 2726]
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 Sun, 23 Mar 2008 20:00:17 -0400 by phpDocumentor 1.4.0. PEAR Logo Copyright © PHP Group 2004.
|
|