Class jDuration

Description

Utility to manipulate durations between two instants

Located in /utils/jDuration.class.php (line 17)


	
			
Variable Summary
mixed $days
mixed $months
mixed $seconds
Method Summary
jDuration __construct ([int/array $init = 0])
void add (jDuration $data)
void mult (int $scale)
Variables
mixed $days (line 19)
  • access: public
mixed $months (line 18)
  • access: public
mixed $seconds (line 20)
  • access: public
Methods
Constructor __construct (line 37)

Construct a new duration.

You can specify the duration as a number of seconds, or as an associative array which may contain the keys "year", "month", "day", "hour", "minute" and "second". The former method defines an absolute duration (it will always add the same number of seconds to any given date/time), while the latter defines a relative duration (a duration of one month will for example represent different amounts of time depending on the start date).

This class represents years as 12 months, minutes as 60 seconds and hours as 3600 seconds. There is no general conversion between months and days, nor between days and hours (because of DST).

jDuration __construct (int/array $init)
  • int/array $init: representation of the duration as an absolute number of seconds, or an array.
add (line 80)

Add a duration to the current duration

void add (jDuration $data)
mult (line 90)

Multiply the current duration by an integer

void mult (int $scale)
  • int $scale: the scaling integer

Documentation generated on Thu, 22 Mar 2012 22:15:24 +0100 by phpDocumentor 1.4.3