diff options
author | Derick Rethans <github@derickrethans.nl> | 2016-01-29 15:21:55 +0100 |
---|---|---|
committer | Derick Rethans <github@derickrethans.nl> | 2016-01-29 15:21:55 +0100 |
commit | 822ca45220db0b864af9dc79b94bda03a9323621 (patch) | |
tree | 422df83a291c6f34cbc035a694a6d07a92a9a268 /ext/date/lib/timelib.c | |
parent | fa548e5ca9b275ac383cadddde0f4e6d9a806f24 (diff) | |
download | php-git-822ca45220db0b864af9dc79b94bda03a9323621.tar.gz |
Merge in changes in timelib 2016.01
Diffstat (limited to 'ext/date/lib/timelib.c')
-rw-r--r-- | ext/date/lib/timelib.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ext/date/lib/timelib.c b/ext/date/lib/timelib.c index 73cdfa2d85..b938d9f998 100644 --- a/ext/date/lib/timelib.c +++ b/ext/date/lib/timelib.c @@ -65,6 +65,23 @@ timelib_time* timelib_time_clone(timelib_time *orig) return tmp; } +int timelib_time_compare(timelib_time *t1, timelib_time *t2) +{ + if (t1->sse == t2->sse) { + if (t1->f == t2->f) { + return 0; + } + + if (t1->sse < 0) { + return (t1->f < t2->f) ? 1 : -1; + } else { + return (t1->f < t2->f) ? -1 : 1; + } + } + + return (t1->sse < t2->sse) ? -1 : 1; +} + timelib_rel_time* timelib_rel_time_clone(timelib_rel_time *rel) { timelib_rel_time *tmp = timelib_rel_time_ctor(); |