Calendar
[ class tree: Calendar ] [ index: Calendar ] [ all elements ]

Class: Calendar_Engine_PearDate

Source Location: /Calendar-0.5.5/Engine/PearDate.php

Class Overview


Performs calendar calculations based on the PEAR::Date class Timestamps are in the ISO-8601 format (YYYY-MM-DD HH:MM:SS)


Author(s):

Copyright:

  • 2003-2007 Lorenzo Alberton

Methods


Inherited Variables

Inherited Methods


Class Details

[line 56]
Performs calendar calculations based on the PEAR::Date class Timestamps are in the ISO-8601 format (YYYY-MM-DD HH:MM:SS)


[ Top ]


Method Detail

adjustDate   [line 199]

void adjustDate( int &$y, int &$m, int &$d, int &$h, int &$i, int &$s)

Set the correct date values (useful for math operations on dates)
  • Access: protected

Parameters:

int   &$y   —  year (2003)
int   &$m   —  month (9)
int   &$d   —  day (13)
int   &$h   —  hour (13)
int   &$i   —  minute (34)
int   &$s   —  second (53)

[ Top ]

dateToStamp   [line 174]

string dateToStamp( int $y, int $m, int $d, [int $h = 0], [int $i = 0], [int $s = 0])

Returns a iso-8601 datetime
  • Return: iso-8601 datetime
  • Access: protected

Parameters:

int   $y   —  year (2003)
int   $m   —  month (9)
int   $d   —  day (13)
int   $h   —  hour (13)
int   $i   —  minute (34)
int   $s   —  second (53)

[ Top ]

getDayOfWeek   [line 405]

int getDayOfWeek( int $y, int $m, int $d)

Returns the number of the day of the week (0=sunday, 1=monday...)
  • Return: weekday number
  • Access: protected

Parameters:

int   $y   —  year (2003)
int   $m   —  month (9)
int   $d   —  day (4)

[ Top ]

getDaysInMonth   [line 292]

int getDaysInMonth( int $y, int $m)

Returns the number of days in a month, given year and month
  • Return: days in month
  • Access: protected

Parameters:

int   $y   —  year (2003)
int   $m   —  month (9)

[ Top ]

getDaysInWeek   [line 322]

int getDaysInWeek( [int $y = null], [int $m = null], [int $d = null])

Returns the number of days in a week
  • Return: (7)
  • Access: protected

Parameters:

int   $y   —  year (2003)
int   $m   —  month (9)
int   $d   —  day (4)

[ Top ]

getFirstDayInMonth   [line 307]

int getFirstDayInMonth( int $y, int $m)

Returns numeric representation of the day of the week in a month, given year and month
  • Return: from 0 to 7
  • Access: protected

Parameters:

int   $y   —  year (2003)
int   $m   —  month (9)

[ Top ]

getFirstDayOfWeek   [line 435]

int getFirstDayOfWeek( [int $y = null], [int $m = null], [int $d = null])

Returns the default first day of the week
  • Return: (default 1 = Monday)
  • Access: protected

Parameters:

int   $y   —  year (2003)
int   $m   —  month (9)
int   $d   —  day (4)

[ Top ]

getHoursInDay   [line 450]

int getHoursInDay( [int $y = null], [int $m = null], [int $d = null])

Returns the number of hours in a day
  • Return: (24)
  • Access: protected

Parameters:

int   $y   —  year (2003)
int   $m   —  month (9)
int   $d   —  day (4)

[ Top ]

getMaxYears   [line 254]

int getMaxYears( )

The upper limit on years that the Calendar Engine can work with
  • Return: 9999
  • Access: protected

[ Top ]

getMinutesInHour   [line 466]

int getMinutesInHour( [int $y = null], [int $m = null], [int $d = null], [int $h = null])

Returns the number of minutes in an hour
  • Return: (60)
  • Access: protected

Parameters:

int   $y   —  year (2003)
int   $m   —  month (9)
int   $d   —  day (4)
int   $h   —  hour

[ Top ]

getMinYears   [line 265]

int getMinYears( )

The lower limit on years that the Calendar Engine can work with
  • Access: protected

[ Top ]

getMonthsInYear   [line 278]

int getMonthsInYear( [int $y = null])

Returns the number of months in a year
  • Return: (12)
  • Access: protected

Parameters:

int   $y   —  year

[ Top ]

getSecondsInMinute   [line 483]

int getSecondsInMinute( [int $y = null], [int $m = null], [int $d = null], [int $h = null], [int $i = null])

Returns the number of seconds in a minutes
  • Return: (60)
  • Access: protected

Parameters:

int   $y   —  year (2003)
int   $m   —  month (9)
int   $d   —  day (4)
int   $h   —  hour
int   $i   —  minute

[ Top ]

getWeekDays   [line 420]

array getWeekDays( [int $y = null], [int $m = null], [int $d = null])

Returns a list of integer days of the week beginning 0
  • Return: (0, 1, 2, 3, 4, 5, 6) 1 = Monday
  • Access: protected

Parameters:

int   $y   —  year (2003)
int   $m   —  month (9)
int   $d   —  day (4)

[ Top ]

getWeekNInMonth   [line 355]

int getWeekNInMonth( int $y, int $m, int $d, [int $firstDay = 1])

Returns the number of the week in the month, given a date
  • Return: week number
  • Access: protected

Parameters:

int   $y   —  year (2003)
int   $m   —  month (9)
int   $d   —  day (4)
int   $firstDay   —  first day of the week (default: monday)

[ Top ]

getWeekNInYear   [line 337]

int getWeekNInYear( int $y, int $m, int $d)

Returns the number of the week in the year (ISO-8601), given a date
  • Return: week number
  • Access: protected

Parameters:

int   $y   —  year (2003)
int   $m   —  month (9)
int   $d   —  day (4)

[ Top ]

getWeeksInMonth   [line 377]

int getWeeksInMonth( int $y, int $m, [int $firstDay = 1])

Returns the number of weeks in the month
  • Return: weeks number
  • Access: protected

Parameters:

int   $y   —  year (2003)
int   $m   —  month (9)
int   $firstDay   —  first day of the week (default: monday)

[ Top ]

isToday   [line 496]

boolean isToday( mixed $stamp)

Checks if the given day is the current day
  • Access: protected

Parameters:

mixed   $stamp   —  Any timestamp format recognized by Pear::Date

[ Top ]

stampCollection   [line 68]

object Pear::Date stampCollection( mixed $stamp)

Makes sure a given timestamp is only ever parsed once Uses a static variable to prevent date() being used twice for a date which is already known
  • Return: object
  • Access: protected

Parameters:

mixed   $stamp   —  Any timestamp format recognized by Pear::Date

[ Top ]

stampToDay   [line 113]

int stampToDay( string $stamp)

Returns a numeric day given a iso-8601 datetime
  • Return: day (e.g. 15)
  • Access: protected

Parameters:

string   $stamp   —  iso-8601 datetime (YYYY-MM-DD HH:MM:SS)

[ Top ]

stampToHour   [line 127]

int stampToHour( string $stamp)

Returns a numeric hour given a iso-8601 datetime
  • Return: hour (e.g. 13)
  • Access: protected

Parameters:

string   $stamp   —  iso-8601 datetime (YYYY-MM-DD HH:MM:SS)

[ Top ]

stampToMinute   [line 141]

int stampToMinute( string $stamp)

Returns a numeric minute given a iso-8601 datetime
  • Return: minute (e.g. 34)
  • Access: protected

Parameters:

string   $stamp   —  iso-8601 datetime (YYYY-MM-DD HH:MM:SS)

[ Top ]

stampToMonth   [line 99]

int stampToMonth( string $stamp)

Returns a numeric month given a iso-8601 datetime
  • Return: month (e.g. 9)
  • Access: protected

Parameters:

string   $stamp   —  iso-8601 datetime (YYYY-MM-DD HH:MM:SS)

[ Top ]

stampToSecond   [line 155]

int stampToSecond( string $stamp)

Returns a numeric second given a iso-8601 datetime
  • Return: second (e.g. 51)
  • Access: protected

Parameters:

string   $stamp   —  iso-8601 datetime (YYYY-MM-DD HH:MM:SS)

[ Top ]

stampToYear   [line 85]

int stampToYear( string $stamp)

Returns a numeric year given a iso-8601 datetime
  • Return: year (e.g. 2003)
  • Access: protected

Parameters:

string   $stamp   —  iso-8601 datetime (YYYY-MM-DD HH:MM:SS)

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:37:48 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.