Representation of date interval. A date interval stores either a fixed amount of time (in years, months, days, hours etc) or a relative time string in the format that DateTime's constructor supports.
Number of years.
Number of months.
Number of days.
Number of hours.
Number of minutes.
Number of seconds.
Is 1 if the interval is inverted and 0 otherwise. See DateInterval::format().
Total number of days the interval spans. If this is unknown, days will be FALSE.
This class became available in PHP 5.3. It is not present in 5.2 or earlier releases. I found this out the hard way when you PHP scripts stopped working when I deployed them onto a Yahoo server. Yahoo has 5.2 while my machine hosts 5.3.
It would be nice that when converting a DateInterval to a string, the interval specification used to construct the object is returned (like "P2W").
I need this to serialize a DateInterval object in order to store it in a postgres DB.