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

Class: Calendar_Engine_UnixTS

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

Class Overview


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


Author(s):

Copyright:

  • 2003-2007 Harry Fuecks

Methods


Inherited Variables

Inherited Methods


Class Details

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


[ Top ]


Method Detail

dateToStamp   [line 183]

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

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

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

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

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

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

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

int getMaxYears( )

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

[ Top ]

getMinutesInHour   [line 419]

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

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

int getMonthsInYear( [int $y = null])

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

Parameters:

int   $y     year

[ Top ]

getSecondsInMinute   [line 436]

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

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

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

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

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

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

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

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

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

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

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

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

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 Thu, 24 Jun 2010 14:00:12 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.