Class Duration
Class representing a Duration in a GedcomX formal date.
The form of a Duration string is
P[yyyyY][mmM][ddD][T[hhH][mmM][ssS]]
for a duration in years, months, days, hours, minutes and/or seconds.
User: Danny Yeshurun (ported from Java code)
Methods summary
public
|
#
parse( string $durationString )
A parsing method that takes a valid duration string and parses it into a Duration object.
A parsing method that takes a valid duration string and parses it into a Duration object.
Parameters
- $durationString
- of the form "P[yyyyY][mmM][ddD][T[hhH][mmM][ssS]]" that specifies a duration.
Throws
Exception
|
public
true
|
#
isValid( )
Tell whether the Duration is valid, which means that at least one of its values is non-null,
and none exceeds the 2-digit limit (or 4 digits for year).
Tell whether the Duration is valid, which means that at least one of its values is non-null,
and none exceeds the 2-digit limit (or 4 digits for year).
Returns
true if valid, false otherwise.
|
public
string
|
#
__toString( )
Convert this Duration to the canonical string for a Duration, of the form:
P[yyyyY][mmM][ddD][T[hhH][mmM][ssS]]
for use in a GedcomX formal date string.
Convert this Duration to the canonical string for a Duration, of the form: P[yyyyY][mmM][ddD][T[hhH][mmM][ssS]]
for use in a GedcomX formal date string.
Returns
string
|
public
|
#
setDay( integer $day )
Set the duration day.
Parameters
|
public
integer
|
#
getDay( )
Get the duration day, or null if not specified.
Get the duration day, or null if not specified.
Returns
integer
|
public
|
#
setHour( integer $hour )
Set the duration hour.
Parameters
|
public
integer
|
#
getHour( )
Get the duration hour, or null if not specified.
Get the duration hour, or null if not specified.
Returns
integer
|
public
|
#
setMinute( integer $minute )
Set the duration minute.
Parameters
|
public
integer
|
#
getMinute( )
Get the duration minute, or null if not specified.
Get the duration minute, or null if not specified.
Returns
integer
|
public
|
#
setMonth( integer $month )
Set the duration month.
Parameters
|
public
integer
|
#
getMonth( )
Get the duration month, or null if not specified.
Get the duration month, or null if not specified.
Returns
integer
|
public
|
#
setSecond( integer $second )
Set the duration second.
Parameters
|
public
integer
|
#
getSecond( )
Get the duration second, or null if not specified.
Get the duration second, or null if not specified.
Returns
integer
|
public
|
#
setYear( integer $year )
Set the duration year.
Parameters
|
public
integer
|
#
getYear( )
Get the duration year, or null if not specified.
Get the duration year, or null if not specified.
Returns
integer
|