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

Class: Calendar_Engine_UnixTS

Source Location: /Calendar-0.5.2/Engine/UnixTS.php

Class Overview


Performs calendar calculations based on the PHP date() function and Unix timestamps (using PHP's mktime() function).


Author(s):

Methods


Inherited Variables

Inherited Methods


Class Details

[line 32]
Performs calendar calculations based on the PHP date() function and Unix timestamps (using PHP's mktime() function).
  • Access: protected


[ Top ]


Method Detail

dateToStamp   [line 148]

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

Returns a timestamp
  • Return: Unix timestamp
  • 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 309]

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 194]

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 224]

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 209]

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 6
  • Access: protected

Parameters:

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

[ Top ]

getFirstDayOfWeek   [line 337]

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 347]

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

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

Parameters:

   $y   — 
   $m   — 
   $d   — 

[ Top ]

getMaxYears   [line 162]

int getMaxYears( )

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

[ Top ]

getMinutesInHour   [line 357]

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

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

Parameters:

   $y   — 
   $m   — 
   $d   — 
   $h   — 

[ Top ]

getMinYears   [line 172]

int getMinYears( )

The lower limit on years that the Calendar Engine can work with
  • Return: (1970 if it's Windows and 1902 for all other OSs)
  • Access: protected

[ Top ]

getMonthsInYear   [line 182]

int getMonthsInYear( [ $y = null])

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

Parameters:

   $y   — 

[ Top ]

getSecondsInMinute   [line 367]

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

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

Parameters:

   $y   — 
   $m   — 
   $d   — 
   $h   — 
   $i   — 

[ Top ]

getWeekDays   [line 324]

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 253]

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 237]

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 276]

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 ]

stampCollection   [line 55]

array stampCollection( int $stamp)

Makes sure a given timestamp is only ever parsed once

 array (
  [0] => year (e.g 2003),
  [1] => month (e.g 9),
  [2] => day (e.g 6),
  [3] => hour (e.g 14),
  [4] => minute (e.g 34),
  [5] => second (e.g 45),
  [6] => num days in month (e.g. 31),
  [7] => week in year (e.g. 50),
  [8] => day in week (e.g. 0 for Sunday)
 )
Uses a static variable to prevent date() being used twice for a date which is already known

  • Access: protected

Parameters:

int   $stamp   —  Unix timestamp

[ Top ]

stampToDay   [line 95]

int stampToDay( int $stamp)

Returns a numeric day given a timestamp
  • Return: day (e.g. 15)
  • Access: protected

Parameters:

int   $stamp   —  Unix timestamp

[ Top ]

stampToHour   [line 107]

int stampToHour( int $stamp)

Returns a numeric hour given a timestamp
  • Return: hour (e.g. 13)
  • Access: protected

Parameters:

int   $stamp   —  Unix timestamp

[ Top ]

stampToMinute   [line 119]

int stampToMinute( int $stamp)

Returns a numeric minute given a timestamp
  • Return: minute (e.g. 34)
  • Access: protected

Parameters:

int   $stamp   —  Unix timestamp

[ Top ]

stampToMonth   [line 83]

int stampToMonth( int $stamp)

Returns a numeric month given a timestamp
  • Return: month (e.g. 9)
  • Access: protected

Parameters:

int   $stamp   —  Unix timestamp

[ Top ]

stampToSecond   [line 131]

int stampToSecond( int $stamp)

Returns a numeric second given a timestamp
  • Return: second (e.g. 51)
  • Access: protected

Parameters:

int   $stamp   —  Unix timestamp

[ Top ]

stampToYear   [line 71]

int stampToYear( int $stamp)

Returns a numeric year given a timestamp
  • Return: year (e.g. 2003)
  • Access: protected

Parameters:

int   $stamp   —  Unix timestamp

[ Top ]


Documentation generated on Mon, 11 Mar 2019 13:54:44 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.