Provide a useful way of dealing with RFC5545 duration strings of the form ^(-?)P(?:(\d+W)|(?:(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S?)?)?))$ This doesn't fully implement the RFC, as it allows PT10H10S - which should be invalid as no minutes are present.
Definition at line 79 of file RRule.php.
static Rfc5545Duration::fromTwoDates |
( |
|
$d1, |
|
|
|
$d2 |
|
) |
| |
|
static |
Factory method to return an Rfc5545Duration object from the difference between two dates.
This is flawed, at present: we should really localise both dates and work out the difference in days, then localise the times and work out the difference between the clock times. On the other hand we're replacing a quick and dirty hack that did it exactly the same way in the past, so we're not making things any worse and at least we're making it clear that it could be improved...
The problem strikes (as they all do) across DST boundaries.
- Todo:
- Improve this to calculate the days difference and then the clock time diff and work from there.
- Parameters
-
- Returns
- Rfc5545Duration
Definition at line 198 of file RRule.php.