dev.obliquid.com: pear
[ class tree: pear ] [ index: pear ] [ all elements ]

Class: Date_Human

Source Location: Program_Root/classes/pear/Date/Human.php

Class Overview


Class to convert date strings between Gregorian and Human calendar formats.


Author(s):

Methods


Inherited Variables

Inherited Methods


Class Details

[line 36]
Class to convert date strings between Gregorian and Human calendar formats.

The Human Calendar format has been proposed by Scott Flansburg and can be explained as follows: The year is made up of 13 months Each month has 28 days Counting of months starts from 0 (zero) so the months will run from 0 to 12 New Years day (00) is a monthless day Note: Leap Years are not yet accounted for in the Human Calendar system




Tags:

author:  Allan Kent <mailto:allan@lodestone.co.za>
since:  PHP 4.0.4


[ Top ]


Class Methods


method gregorianToHuman [line 66]

associative gregorianToHuman( [int $day = 0], [int $month = 0], [int $year = 0])

Returns an associative array containing the converted date information in 'Human Calendar' format.



Tags:

return:  array( hdom, // Human Day Of Month, starting at 1 hdow, // Human Day Of Week, starting at 1 hwom, // Human Week of Month, starting at 1 hwoy, // Human Week of Year, starting at 1 hmoy, // Human Month of Year, starting at 0 )If the day is New Years Day, the function will return "hdom" => 0 "hdow" => 0 "hwom" => 0 "hwoy" => 0 "hmoy" => -1 Since 0 is a valid month number under the Human Calendar, I have left the month as -1 for New Years Day.
access:  public


Parameters:

int   $day   day in DD format, default current local day
int   $month   month in MM format, default current local month
int   $year   year in CCYY format, default to current local year

[ Top ]

method HumanToGregorian [line 158]

int HumanToGregorian( int $day, int $month, [int $year = 0])

Returns unix timestamp for a given Human Calendar date



Tags:

return:  unix timestamp of date
access:  public


Parameters:

int   $day   day in DD format
int   $month   month in MM format
int   $year   year in CCYY format, default to current local year

[ Top ]


Documentation generated on Tue, 29 Mar 2005 09:03:55 -0800 by phpDocumentor 1.2.0rc2