width() public method

Returns the width of this span in seconds.
public width ( )
Esempio n. 1
0
 public function testDateMath()
 {
     $d = new Horde_Date('2008-01-01 00:00:00');
     $this->assertEquals('2007-12-31 00:00:00', (string) $d->sub(array('day' => 1)));
     $this->assertEquals('2009-01-01 00:00:00', (string) $d->add(array('year' => 1)));
     $this->assertEquals('2008-01-01 04:00:00', (string) $d->add(14400));
     $span = new Horde_Date_Span('2006-01-01 00:00:00', '2006-08-16 00:00:00');
     $this->assertEquals('2006-04-24 11:30:00', (string) $span->begin->add($span->width() / 2));
 }
Esempio n. 2
0
 public function testWidth()
 {
     $s = new Horde_Date_Span(new Horde_Date('2006-08-16 00:00:00'), new Horde_Date('2006-08-17 00:00:00'));
     $this->assertEquals(60 * 60 * 24, $s->width());
 }