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

Class: Date_Human

Source Location: /Date-1.5.0a4/Date/Human.php

Class Overview


Class to convert date strings between Gregorian and Human calendar formats


Author(s):

Version:

  • Release: 1.5.0a4

Copyright:

  • 1997-2005 Allan Kent

Methods


Inherited Variables

Inherited Methods


Class Details

[line 75]
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



[ Top ]


Method Detail

gregorianToHuman   [line 106]

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

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

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.

  • 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 )
  • Access: public

Parameters:

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

[ Top ]

humanToGregorian   [line 200]

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

Returns unix timestamp for a given Human Calendar date
  • Return: unix timestamp of date
  • Access: public

Parameters:

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

[ Top ]


Documentation generated on Tue, 08 Oct 2013 05:30:22 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.