Class: Date_Calc
Source Location: /Date-1.4.6/Date/Calc.php
Calculates, manipulates and retrieves dates
Author(s):
Version:
Copyright:
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Method Detail
beginOfMonth [line 1397]
string beginOfMonth(
[int
$month = 0], [int
$year = 0], [string
$format = DATE_CALC_FORMAT])
|
|
Return date of first day of month of given date
Parameters:
beginOfMonthBySpan [line 1577]
string beginOfMonthBySpan(
[int
$months = 0], [string
$month = 0], [string
$year = 0], [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 1498]
string beginOfNextMonth(
[int
$day = 0], [int
$month = 0], [int
$year = 0], [string
$format = DATE_CALC_FORMAT])
|
|
Returns date of begin of next month of given date
Parameters:
beginOfNextWeek [line 1357]
string beginOfNextWeek(
[int
$day = 0], [int
$month = 0], [int
$year = 0], [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 1423]
string beginOfPrevMonth(
[int
$day = 0], [int
$month = 0], [int
$year = 0], [string
$format = DATE_CALC_FORMAT])
|
|
Returns date of the first day of previous month of given date
Parameters:
beginOfPrevWeek [line 1315]
string beginOfPrevWeek(
[int
$day = 0], [int
$month = 0], [int
$year = 0], [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 1247]
string beginOfWeek(
[int
$day = 0], [int
$month = 0], [int
$year = 0], [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 1918]
int compareDates(
int
$day1, int
$month1, int
$year1, int
$day2, int
$month2, int
$year2)
|
|
Compares two dates
Parameters:
dateDiff [line 1886]
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 119]
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 437]
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 384]
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 231]
integer dateToDays(
int
$day, int
$month, int
$year)
|
|
Converts a date to number of days since a distant unspecified epoch
Parameters:
dayOfWeek [line 691]
int dayOfWeek(
[int
$day = 0], [int
$month = 0], [int
$year = 0])
|
|
Returns day of week for given date (0 = Sunday)
Parameters:
daysInMonth [line 786]
int daysInMonth(
[int
$month = 0], [int
$year = 0])
|
|
Find the number of days in the given month
Parameters:
daysToDate [line 264]
string daysToDate(
int
$days, [string
$format = DATE_CALC_FORMAT])
|
|
Converts number of days to a distant unspecified epoch
Parameters:
defaultCentury [line 205]
string defaultCentury(
int
$year)
|
|
Turns a two digit year into a four digit year From '51 to '99 is in the 1900's, otherwise it's in the 2000's.
Parameters:
endOfMonthBySpan [line 1634]
string endOfMonthBySpan(
[int
$months = 0], [string
$month = 0], [string
$year = 0], [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 1536]
string endOfNextMonth(
[int
$day = 0], [int
$month = 0], [int
$year = 0], [string
$format = DATE_CALC_FORMAT])
|
|
Returns date of the last day of next month of given date
Parameters:
endOfPrevMonth [line 1461]
string endOfPrevMonth(
[int
$day = 0], [int
$month = 0], [int
$year = 0], [string
$format = DATE_CALC_FORMAT])
|
|
Returns date of the last day of previous month for given date
Parameters:
endOfWeek [line 1281]
string endOfWeek(
[int
$day = 0], [int
$month = 0], [int
$year = 0], [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:
firstOfMonthWeekday [line 1684]
int firstOfMonthWeekday(
[int
$month = 0], [int
$year = 0])
|
|
Find the day of the week for the first of the month of given date
Parameters:
getCalendarMonth [line 901]
array getCalendarMonth(
[int
$month = 0], [int
$year = 0], [string
$format = DATE_CALC_FORMAT])
|
|
Return a set of arrays to construct a calendar month for the given date
Parameters:
getCalendarWeek [line 863]
array getCalendarWeek(
[int
$day = 0], [int
$month = 0], [int
$year = 0], [string
$format = DATE_CALC_FORMAT])
|
|
Return an array with days in week
Parameters:
getCalendarYear [line 952]
array getCalendarYear(
[int
$year = 0], [string
$format = DATE_CALC_FORMAT])
|
|
Return a set of arrays to construct a calendar year for the given date
Parameters:
getDay [line 476]
Returns the current local day in format DD
getMonth [line 463]
Returns the current local month in format MM
getMonthAbbrname [line 601]
string getMonthAbbrname(
int
$month, [int
$length = 3])
|
|
Returns the abbreviated month name for the given month
Parameters:
getMonthFromFullName [line 623]
integer getMonthFromFullName(
string
$month)
|
|
Returns the numeric month from the month name or an abreviation Both August and Aug would return 8.
Parameters:
getMonthFullname [line 579]
string getMonthFullname(
int
$month)
|
|
Returns the full month name for the given month
Parameters:
getMonthNames [line 649]
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 preformace hits when called more than once.
getWeekdayAbbrname [line 554]
string getWeekdayAbbrname(
[int
$day = 0], [int
$month = 0], [int
$year = 0], [int
$length = 3])
|
|
Returns the abbreviated weekday name for the given date
Parameters:
getWeekdayFullname [line 524]
string getWeekdayFullname(
[int
$day = 0], [int
$month = 0], [int
$year = 0])
|
|
Returns the full weekday name for the given date
Parameters:
getWeekDays [line 671]
Returns an array of week days Used to take advantage of the setlocale function to return language specific week days. TODO: cache values to some global array to avoid preformace hits when called more than once.
getYear [line 450]
Returns the current local year in format CCYY
gregorianToISO [line 312]
string gregorianToISO(
int
$day, int
$month, int
$year)
|
|
Converts from Gregorian Year-Month-Day to ISO Year-WeekNumber-WeekDay Uses ISO 8601 definitions. Algorithm by Rick McCarty, 1999 at http://personal.ecu.edu/mccartyr/ISOwdALG.txt . Transcribed to PHP by Jesus M. Castagnetto.
Parameters:
isFutureDate [line 1812]
boolean isFutureDate(
int
$day, int
$month, int
$year)
|
|
Determines if given date is a future date from now
Parameters:
isLeapYear [line 1778]
boolean isLeapYear(
[int
$year = 0])
|
|
Returns true for a leap year, else false
Parameters:
isPastDate [line 1846]
boolean isPastDate(
int
$day, int
$month, int
$year)
|
|
Determines if given date is a past date from now
Parameters:
isValidDate [line 1755]
boolean isValidDate(
int
$day, int
$month, int
$year)
|
|
Returns true for valid date, false for invalid date
Parameters:
julianDate [line 493]
int julianDate(
[int
$day = 0], [int
$month = 0], [int
$year = 0])
|
|
Returns number of days since 31 December of year before given date
Parameters:
nextDay [line 1011]
string nextDay(
[int
$day = 0], [int
$month = 0], [int
$year = 0], [string
$format = DATE_CALC_FORMAT])
|
|
Returns date of day after given date
Parameters:
nextDayOfWeek [line 1158]
string nextDayOfWeek(
int
$dow, [int
$day = 0], [int
$month = 0], [int
$year = 0], [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 1224]
string nextDayOfWeekOnOrAfter(
int
$dow, [int
$day = 0], [int
$month = 0], [int
$year = 0], [string
$format = DATE_CALC_FORMAT])
|
|
Returns date of the next specific day of the week on or after the given date
Parameters:
nextWeekday [line 1077]
string nextWeekday(
[int
$day = 0], [int
$month = 0], [int
$year = 0], [string
$format = DATE_CALC_FORMAT])
|
|
Returns date of the next weekday of given date, skipping from Friday to Monday
Parameters:
NWeekdayOfMonth [line 1713]
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 982]
string prevDay(
[int
$day = 0], [int
$month = 0], [int
$year = 0], [string
$format = DATE_CALC_FORMAT])
|
|
Returns date of day before given date
Parameters:
prevDayOfWeek [line 1116]
string prevDayOfWeek(
int
$dow, [int
$day = 0], [int
$month = 0], [int
$year = 0], [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 1202]
string prevDayOfWeekOnOrBefore(
int
$dow, [int
$day = 0], [int
$month = 0], [int
$year = 0], [string
$format = DATE_CALC_FORMAT])
|
|
Returns date of the previous specific day of the week on or before the given date
Parameters:
prevWeekday [line 1040]
string prevWeekday(
[int
$day = 0], [int
$month = 0], [int
$year = 0], [string
$format = DATE_CALC_FORMAT])
|
|
Returns date of the previous weekday, skipping from Monday to Friday
Parameters:
quarterOfYear [line 760]
int quarterOfYear(
[int
$day = 0], [int
$month = 0], [int
$year = 0])
|
|
Returns quarter of the year for given date
Parameters:
weekOfYear [line 731]
int weekOfYear(
[int
$day = 0], [int
$month = 0], [int
$year = 0])
|
|
Returns week of the year, first Sunday is first day of first week
Parameters:
weeksInMonth [line 826]
int weeksInMonth(
[int
$month = 0], [int
$year = 0])
|
|
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 14:05:34 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|