diff options
author | Derick Rethans <github@derickrethans.nl> | 2016-10-05 11:24:15 -0400 |
---|---|---|
committer | Derick Rethans <github@derickrethans.nl> | 2016-10-05 15:03:06 -0400 |
commit | 55626549d81d0feadb1d160be78fcf2b898a48cc (patch) | |
tree | a00c6239804f2ad68ccc3470e63e83eb18f7897f /ext/date/lib/interval.c | |
parent | d5b77d66626b138a83b6c0d16f746893fefa29ee (diff) | |
download | php-git-microseconds.tar.gz |
Improve support for microseconds with Date/Timemicroseconds
It fixes several bugs:
- Fixed bug #45554 (Inconsistent behavior of the u format char).
- Fixed bug #48225 (DateTime parser doesn't set microseconds for "now").
- Fixed bug #52514 (microseconds are missing in DateTime class).
- Fixed bug #52519 (microseconds in DateInterval are missing).
- Fixed bug #68506 (General DateTime improvments needed for microseconds to become useful).
- Fixed bug #73109 (timelib_meridian doesn't parse dots correctly).
- Fixed bug #73247 (DateTime constructor does not initialise microseconds property).
It also updates timelib to 2016.04, and updates a data mapping file, which
causes changes to the volatile abbreviations tests.
Diffstat (limited to 'ext/date/lib/interval.c')
-rw-r--r-- | ext/date/lib/interval.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/date/lib/interval.c b/ext/date/lib/interval.c index 9c1cc3b273..dee9f92eed 100644 --- a/ext/date/lib/interval.c +++ b/ext/date/lib/interval.c @@ -65,6 +65,7 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two) rt->h = two->h - one->h; rt->i = two->i - one->i; rt->s = two->s - one->s; + rt->f = two->f - one->f; if (one_backup.dst == 0 && two_backup.dst == 1 && two->sse >= one->sse + 86400 - dst_corr) { rt->h += dst_h_corr; rt->i += dst_m_corr; @@ -110,6 +111,7 @@ timelib_time *timelib_add(timelib_time *old_time, timelib_rel_time *interval) t->relative.h = interval->h * bias; t->relative.i = interval->i * bias; t->relative.s = interval->s * bias; + t->relative.f = interval->f * bias; } t->have_relative = 1; t->sse_uptodate = 0; @@ -145,6 +147,7 @@ timelib_time *timelib_sub(timelib_time *old_time, timelib_rel_time *interval) t->relative.h = 0 - (interval->h * bias); t->relative.i = 0 - (interval->i * bias); t->relative.s = 0 - (interval->s * bias); + t->relative.f = 0 - (interval->f * bias); t->have_relative = 1; t->sse_uptodate = 0; |