Gumbo_Interface_Date
Methods
- diff
- diffDay
- diffMonth
- diffWeek
- diffYear
- get
- getCentury
- getDate
- getDay
- getHour
- getMinute
- getMonth
- getMonthFacts
- getSecond
- getTime
- getWeek
- getYear
- isApril
- isAugust
- isDecember
- isFall
- isFebruary
- isFriday
- isHoliday
- isJanuary
- isJuly
- isJune
- isLeapYear
- isMarch
- isMay
- isMonday
- isNovember
- isOctober
- isSaturday
- isSeptember
- isSpring
- isSummer
- isSunday
- isThursday
- isTuesday
- isWednesday
- isWeekday
- isWeekend
- isWinter
- meridien
- nextDay
- nextHour
- nextMinute
- nextMonth
- nextSecond
- nextWeek
- nextYear
- prevDay
- prevHour
- prevMinute
- prevMonth
- prevSecond
- prevWeek
- prevYear
- reset
- setDate
- setDateEpoch
- setDateStamp
- setDay
- setHoliday
- setHour
- setMinute
- setMonth
- setSeconds
- setTime
- setYear
- totalDays
- zeroHour
Date Interface
Author(s): |
Michael Luster <mluster79@yahoo.com> |
License: | New BSD License |
Copyright: | Copyright (c) 2007, iBayou, Michael Luster |
Link: | http://sourceforge.net/projects/phpgumbo |
Version: | 0.0.1 |
Interface Methods
Checks if the current year is a Leap Year
Parameter(s):
- (int) $year
- throws:
Gumbo_Exception
[ Top ]public array diff ( Gumbo_Interface_Date $date ) [line 618]Returns the difference from the supplied Date
Parameter(s):
- (Gumbo_Interface_Date) $date
- return:
[when|year|month|day|hour|minute|second]
[ Top ]public int diffDay ( Gumbo_Interface_Date $val ) [line 646]Returns the number of Days difference
Parameter(s):
- (Gumbo_Interface_Date) $val
[ Top ]public int diffMonth ( Gumbo_Interface_Date $val ) [line 632]Returns the number of Months difference
Parameter(s):
- (Gumbo_Interface_Date) $val
[ Top ]public int diffWeek ( Gumbo_Interface_Date $val ) [line 639]Returns the number of Weeks difference
Parameter(s):
- (Gumbo_Interface_Date) $val
[ Top ]public int diffYear ( int|Gumbo_Interface_Date $val ) [line 625]Returns the number of Years difference
Parameter(s):
- (int|Gumbo_Interface_Date) $val
[ Top ]public int|string get ( [int $format] ) [line 285]Returns a Date string in predefined format
Format Codes:
- 0 => yyyy-mm-dd hh:mm:ss (MySQL DATETIME)
- 1 => yyyymm
- 2 => yyyymmdd
- 3 => yyyymmddhh
- 4 => yyyymmddhhmm
- 5 => yyyymmddhhmmss
- 6 => UNIX EPOCH
Parameter(s):
- (int) $format :: format code
- throws:
Gumbo_Exception
[ Top ]public int|string getCentury ( [ $as_string] ) [line 337]Returns the Century
Parameter(s):
- () $as_string
- throws:
Gumbo_Exception - uses:
Gumbo_Number
[ Top ]public void getDate ( [string|int $format] ) [line 308]Returns a formatted Date string
Date Formats:
- 0 => yyyy-mm-dd (default)
- 1 => yyyymm
- 2 => yyyymmdd
- 3 => mm/dd/yyyy
- 4 => [m]m/[d]d/yyyy
- 5 => Mon [d]d[suffix], yyyy
- 6 => Month [d]d[suffix], yyyy
- 7 => Day, [d]d Mon yyyy
Parameter(s):
- (string|int) $format :: pre-defined format code or string stamp
- throws:
Gumbo_Exception - uses:
Gumbo_Number
[ Top ]public int|string getDay ( [int $format] ) [line 388]Returns the Day in the requested format
Formats:
- 0 => [d]d
- 1 => dd
- 2 => ## (numerical day of week)
- 3 => Day (abbreviation)
- 4 => Day (full name)
- 5 => ## (day of year)
Parameter(s):
- (int) $format
- throws:
Gumbo_Exception
[ Top ]public int|string getHour ( [int $format] ) [line 403]Returns the Hour in the requested format
Formats:
- 0 => [h]h (24-hour format)
- 1 => hh (24-hour format)
- 2 => [h]h (12-hour format)
- 3 => hh (12-hour format)
Parameter(s):
- (int) $format
- throws:
Gumbo_Exception
[ Top ]public int|string getMinute ( [int $format] ) [line 416]Returns the Minutes in the requested format
Format:
- 0 => [m]m
- 1 => mm
Parameter(s):
- (int) $format
- throws:
Gumbo_Exception
[ Top ]public int|string getMonth ( [int $format] ) [line 365]Returns the Month in the requested format
Formats:
- -> [m]m
- -> mm
- -> Mon (abbreviation)
- -> Month (full name)
Parameter(s):
- (int) $format
- throws:
Gumbo_Exception
[ Top ]public int|string getSecond ( [int $format] ) [line 429]Returns the Seconds in the requested format
Format:
- 0 => [s]s
- 1 => ss
Parameter(s):
- (int) $format
- throws:
Gumbo_Exception
[ Top ]public string getTime ( [int $format] ) [line 329]Returns a formatted Time string
Time Format:
- 0 => hh:mm:ss (default)
- 1 => hh
- 2 => hhmm
- 3 => hhmmss
- 4 => hh:mm
- 5 => hh:mm [am|pm]
- 6 => [h]h:mm
- 7 => [h]h:mm [am|pm]
- 8 => hh:mm:ss
- 9 => hh:mm:ss [am|pm]
- 10 => [h]h:mm:ss
- 11 => [h]h:mm:ss [am|pm]
Parameter(s):
- (int) $format :: pre-defined time format
- throws:
Gumbo_Exception
[ Top ]public int|string getYear ( [int $format] ) [line 350]Returns the Year requested format
Formats:
- -> yyyy
- -> yy
Parameter(s):
- (int) $format
- throws:
Gumbo_Exception
[ Top ]public string meridien ( [bool $in_caps] ) [line 656]Returns the AM/PM time value
Parameter(s):
- (bool) $in_caps :: returns value in caps
- throws:
Gumbo_Exception
[ Top ]public void nextDay ( [int $num] ) [line 90]Increases the Day
Parameter(s):
- (int) $num
- precondition:
$num > 0 - throws:
Gumbo_Exception
[ Top ]public void nextHour ( [int $num] ) [line 98]Increases the Hour
Parameter(s):
- (int) $num
- precondition:
$num > 0 - throws:
Gumbo_Exception
[ Top ]public void nextMinute ( [int $num] ) [line 106]Increases the Minutes
Parameter(s):
- (int) $num
- precondition:
$num > 0 - throws:
Gumbo_Exception
[ Top ]public void nextMonth ( [int $num] ) [line 74]Increases the Month by number.
Parameter(s):
- (int) $num
- precondition:
$num > 0 - throws:
Gumbo_Exception
[ Top ]public void nextSecond ( [int $num] ) [line 114]Increases the Seconds
Parameter(s):
- (int) $num
- precondition:
$num > 0 - throws:
Gumbo_Exception
[ Top ]public void nextWeek ( [int $num] ) [line 82]Increases the Week
Parameter(s):
- (int) $num
- precondition:
$num > 0 - throws:
Gumbo_Exception
[ Top ]public void nextYear ( [int $num] ) [line 66]Increases the Year by number
Parameter(s):
- (int) $num
- precondition:
$num > 0 - throws:
Gumbo_Exception
[ Top ]public void prevDay ( [int $num] ) [line 146]Decreases the Day
Parameter(s):
- (int) $num
- precondition:
$num > 0 - throws:
Gumbo_Exception
[ Top ]public void prevHour ( [int $num] ) [line 154]Decreases the Hour
Parameter(s):
- (int) $num
- precondition:
$num > 0 - throws:
Gumbo_Exception
[ Top ]public void prevMinute ( [int $num] ) [line 162]Decreases the Minutes
Parameter(s):
- (int) $num
- precondition:
$num > 0 - throws:
Gumbo_Exception
[ Top ]public void prevMonth ( [int $num] ) [line 130]Decreases the Month
Parameter(s):
- (int) $num
- precondition:
$num > 0 - throws:
Gumbo_Exception
[ Top ]public void prevSecond ( [int $num] ) [line 170]Decreases the Seconds
Parameter(s):
- (int) $num
- precondition:
$num > 0 - throws:
Gumbo_Exception
[ Top ]public void prevWeek ( [int $num] ) [line 138]Decreases the Week
Parameter(s):
- (int) $num
- precondition:
$num > 0 - throws:
Gumbo_Exception
[ Top ]public void prevYear ( [int $num] ) [line 122]Decreases the Year
Parameter(s):
- (int) $num
- precondition:
$num > 0 - throws:
Gumbo_Exception
[ Top ]public void setDate ( int $year, int $month, int $day ) [line 188]Sets the Date values of the object
Parameter(s):
- (int) $year
- (int) $month
- (int) $day
[ Top ]public void setDateEpoch ( int $time ) [line 210]Sets the Date by the UNIX Epoch
Parameter(s):
- (int) $time
- throws:
Gumbo_Exception
[ Top ]public void setDateStamp ( mixed $stamp ) [line 203]Sets the Date by a stamp parsed down to yyyymmdd[hhmmss] format
Parameter(s):
- (mixed) $stamp
- throws:
Gumbo_Exception
[ Top ]0 < $val <= 31 - throws:
Gumbo_Exception
[ Top ]public void setHoliday ( bool $val ) [line 180]Marks the Date as a Holiday
Parameter(s):
- (bool) $val
- throws:
Gumbo_Exception
[ Top ]0 <= $val < 24 - throws:
Gumbo_Exception
[ Top ]public void setMinute ( int $min ) [line 254]Sets the Minute
Parameter(s):
- (int) $min
- precondition:
0 <= $val < 60 - throws:
Gumbo_Exception
[ Top ]public void setMonth ( int|string $month ) [line 230]Sets the Month
The value can be the numberical month, a three-letter abbreviation of the month name, or the full name.
Parameter(s):
- (int|string) $month
- precondition:
if int, 0 < $val < 13 - throws:
Gumbo_Exception
[ Top ]public void setSeconds ( int $sec ) [line 262]Sets the Seconds
Parameter(s):
- (int) $sec
- precondition:
0 <= $val < 60 - throws:
Gumbo_Exception
[ Top ]public void setTime ( int $hour, int $minutes, int $seconds ) [line 196]Sets the Time values of object
Parameter(s):
- (int) $hour
- (int) $minutes
- (int) $seconds
[ Top ]$val > 0 - throws:
Gumbo_Exception
[ Top ]public int totalDays ( [int $month] ) [line 445]Returns the total days within a month
Parameter(s):
- (int) $month
- throws:
Gumbo_Exception
[ Top ]$hour=0 - postcondition:
$minutes=0 - postcondition:
$seconds=0
[ Top ]