Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

ODate Class Reference

List of all members.

Public Member Functions

 __construct ($y=0, $mt=0, $d=0, $h=0, $m=0, $s=0)
 ODate ($y=0, $mt=0, $d=0, $h=0, $m=0, $s=0)
 add ($date)
 inc ($y, $mt, $d, $h, $m, $s)
 setDate ($y, $m, $d)
 setTime ($y, $m, $d)
 addYears ($y)
 addMonths ($m)
 addDays ($d)
 addHours ($h)
 addMinutes ($m)
 addSeconds ($s)
 isBissextile ()
 numberOfMonthDays ()
 setNow ()
 cleanup ()
 compare ($date)
 toNumericString ()
 toString ($format="%04d-%02d-%02d %02d:%02d:%02d")
 getYear ()
 getMonth ()
 getDay ()
 getHours ()
 getMinutes ()
 getSeconds ()
 setYear ($y)
 setMonth ($m)
 setDay ($d)
 setHours ($h)
 setMinutes ($m)
 setSeconds ($s)

Public Attributes

 $_year = 0
 $_month = 0
 $_day = 0
 $_hours = 0
 $_minutes = 0
 $_seconds = 0

Detailed Description

Simple date manipulation object.

Note: -----

ODate::toString() can take a sprintf() format string as first parameter.

Author:
Laurent Bedubourg <laurent.bedubourg@free.fr>

Definition at line 47 of file ODate.php.


Constructor & Destructor Documentation

ODate::ODate y = 0,
mt = 0,
d = 0,
h = 0,
m = 0,
s = 0
 

ODate constructor.

Parameters:
int $y optional -- year
int $mt optional -- month
int $d optional -- day
int $h optional -- hour
int $m optional -- minutes
int $s optional -- seconds

Definition at line 89 of file ODate.php.


Member Function Documentation

ODate::__construct y = 0,
mt = 0,
d = 0,
h = 0,
m = 0,
s = 0
 

ODate constructor.

This constructor is for php v4.4 compliance.

Parameters:
int $y optional -- year
int $mt optional -- month
int $d optional -- day
int $h optional -- hour
int $m optional -- minutes
int $s optional -- seconds

Definition at line 68 of file ODate.php.

References __construct(), setDay(), setHours(), setMinutes(), setMonth(), setSeconds(), and setYear().

Referenced by __construct().

ODate::add date  ) 
 

Add a date to current date.

Definition at line 98 of file ODate.php.

References add(), and inc().

Referenced by add().

ODate::addDays d  ) 
 

Add some days to this date.

Parameters:
int $d -- days

Definition at line 185 of file ODate.php.

References $d, addDays(), and numberOfMonthDays().

Referenced by addDays(), and inc().

ODate::addHours h  ) 
 

Add some hours to this date.

Parameters:
int $h -- hours

Definition at line 202 of file ODate.php.

References addHours().

Referenced by addHours(), and inc().

ODate::addMinutes m  ) 
 

Add minutes to this date.

Parameters:
int $m -- minutes

Definition at line 216 of file ODate.php.

References addMinutes().

Referenced by addMinutes(), and inc().

ODate::addMonths m  ) 
 

Add some months to this date.

Parameters:
int $m -- month

Definition at line 171 of file ODate.php.

References addMonths().

Referenced by addMonths(), and inc().

ODate::addSeconds s  ) 
 

Add seconds to this date.

Parameters:
int $s -- seconds

Definition at line 230 of file ODate.php.

References $s, and addSeconds().

Referenced by addSeconds(), and inc().

ODate::addYears y  ) 
 

Add some years to this date.

Parameters:
int $y -- year

Definition at line 161 of file ODate.php.

References addYears().

Referenced by addYears(), and inc().

ODate::cleanup  ) 
 

Ensure that date is correct.

Definition at line 283 of file ODate.php.

Referenced by toString().

ODate::compare date  ) 
 

Compare with another date, return < 0 if less, == 0 if equals, > 0 if greater.

Parameters:
ODate $date -- date to compare with
Returns:
int (strcmp)

Definition at line 296 of file ODate.php.

References compare().

Referenced by compare().

ODate::getDay  ) 
 

Retrieve day.

Returns:
int

Definition at line 360 of file ODate.php.

ODate::getHours  ) 
 

Retrieve hour.

Returns:
int

Definition at line 369 of file ODate.php.

ODate::getMinutes  ) 
 

Retrieve minutes.

Returns:
int

Definition at line 378 of file ODate.php.

ODate::getMonth  ) 
 

Retrieve month.

Returns:
int

Definition at line 351 of file ODate.php.

ODate::getSeconds  ) 
 

Retrieve seconds.

Returns:
int

Definition at line 387 of file ODate.php.

ODate::getYear  ) 
 

Retrieve year.

Returns:
int

Definition at line 342 of file ODate.php.

ODate::inc y,
mt,
d,
h,
m,
s
 

Add values to this date.

Parameters:
int $y optional -- year
int $mt optional -- month
int $d optional -- day
int $h optional -- hour
int $m optional -- minutes
int $s optional -- seconds

Definition at line 118 of file ODate.php.

References addDays(), addHours(), addMinutes(), addMonths(), addSeconds(), addYears(), and inc().

Referenced by add(), and inc().

ODate::isBissextile  ) 
 

Return true if bissextile year.

Returns:
boolean

Definition at line 244 of file ODate.php.

Referenced by numberOfMonthDays().

ODate::numberOfMonthDays  ) 
 

Get the number of days in current month

Returns:
int

Definition at line 257 of file ODate.php.

References isBissextile().

Referenced by addDays().

ODate::setDate y,
m,
d
 

Set date part.

Parameters:
int $y -- year
int $mt -- month
int $d -- day

Definition at line 135 of file ODate.php.

References setDate(), setDay(), setMonth(), and setYear().

Referenced by setDate().

ODate::setDay d  ) 
 

Set day.

Parameters:
int $d -- day

Definition at line 414 of file ODate.php.

References $d, and setDay().

Referenced by __construct(), setDate(), setDay(), and setNow().

ODate::setHours h  ) 
 

Set hours.

Parameters:
int $h -- hours

Definition at line 423 of file ODate.php.

References setHours().

Referenced by __construct(), setHours(), setNow(), and setTime().

ODate::setMinutes m  ) 
 

Set minutes.

Parameters:
int $m -- minutes

Definition at line 432 of file ODate.php.

References setMinutes().

Referenced by __construct(), setMinutes(), setNow(), and setTime().

ODate::setMonth m  ) 
 

Set month.

Parameters:
int $m -- month

Definition at line 405 of file ODate.php.

References setMonth().

Referenced by __construct(), setDate(), setMonth(), and setNow().

ODate::setNow  ) 
 

Set now time values to this object.

Definition at line 269 of file ODate.php.

References $d, setDay(), setHours(), setMinutes(), setMonth(), setSeconds(), and setYear().

ODate::setSeconds s  ) 
 

Set seconds.

Parameters:
int $s -- seconds

Definition at line 441 of file ODate.php.

References $s, and setSeconds().

Referenced by __construct(), setNow(), setSeconds(), and setTime().

ODate::setTime y,
m,
d
 

Set time part.

Parameters:
int $h -- hour
int $m -- minutes
int $s -- seconds

Definition at line 149 of file ODate.php.

References setHours(), setMinutes(), setSeconds(), and setTime().

Referenced by setTime().

ODate::setYear y  ) 
 

Set year.

Parameters:
int $y -- year

Definition at line 396 of file ODate.php.

References setYear().

Referenced by __construct(), setDate(), setNow(), and setYear().

ODate::toNumericString  ) 
 

Return a concatenation of date fields (numeric date).

Returns:
string

Definition at line 307 of file ODate.php.

ODate::toString format = "%04d-%02d-%02d %02d:%02d:%02d"  ) 
 

Simple date format.

Parameters:
string $format optional Format to pass to sprintf (ex:"%04d-%02d-%02d %02d:%02d:%02d")
Returns:
string

Definition at line 321 of file ODate.php.

References cleanup(), and toString().

Referenced by toString().


Member Data Documentation

ODate::$_day = 0
 

Definition at line 51 of file ODate.php.

ODate::$_hours = 0
 

Definition at line 52 of file ODate.php.

ODate::$_minutes = 0
 

Definition at line 53 of file ODate.php.

ODate::$_month = 0
 

Definition at line 50 of file ODate.php.

ODate::$_seconds = 0
 

Definition at line 54 of file ODate.php.

ODate::$_year = 0
 

Definition at line 49 of file ODate.php.


The documentation for this class was generated from the following file:
Generated on Tue Jun 29 23:40:51 2004 for Mediawiki by doxygen 1.3.7