[Tarantool-patches] [RFC PATCH 07/13] lua: asctime and strfime fixed

Timur Safin tsafin at tarantool.org
Thu Jul 15 11:18:13 MSK 2021


* fixed lua implementation for asctime, and strftime;
* introduced c test for reversible strftime roundtrip;
* introduced lua test for the same (TBD)
---
 src/lua/datetime.lua      |  30 ++-
 test/unit/datetime.c      |  56 ++++-
 test/unit/datetime.result | 460 +++++++++++++++++++++++++++-----------
 3 files changed, 408 insertions(+), 138 deletions(-)

diff --git a/src/lua/datetime.lua b/src/lua/datetime.lua
index 670123b1f..efd953de9 100644
--- a/src/lua/datetime.lua
+++ b/src/lua/datetime.lua
@@ -422,7 +422,7 @@ end
 ]]
 local function parse_zone(str)
     local offset = ffi.new('int[1]')
-    local len = cdt.dt_parse_iso_zone(str, #str, offset)
+    local len = cdt.dt_parse_iso_zone_lenient(str, #str, offset)
     return len > 0 and mk_timestamp(nil, nil, nil, offset[0]) or nil, tonumber(len)
 end
 
@@ -474,7 +474,7 @@ local function parse_str(str)
     len = #str
 
     local offset = ffi.new('int[1]')
-    n = cdt.dt_parse_iso_zone(str, len, offset)
+    n = cdt.dt_parse_iso_zone_lenient(str, len, offset)
     if n == 0 then
         return mk_timestamp(dt_, sp_, fp_)
     end
@@ -507,10 +507,29 @@ local function local_now()
     return datetime_new_raw(secs, nsec, ofs) -- FIXME
 end
 
-local function asctime(o)
-    assert(ffi.typeof(o) == datetime_t)
+local function datetime_to_tm_ptr(o)
     local p_tm = ffi.new 'struct tm[1]'
+    assert(ffi.typeof(o) == datetime_t)
+    -- dt_to_struct_tm() fills only date data
     cdt.dt_to_struct_tm(local_dt(o), p_tm)
+
+    -- calculate the smaller data (hour, minute,
+    -- seconds) using datetime seconds value
+    local seconds_of_day = o.secs % 86400
+    local hour = (seconds_of_day / 3600) % 24
+    local minute = (seconds_of_day / 60) % 60
+    p_tm[0].tm_sec = seconds_of_day % 60
+    p_tm[0].tm_min = minute
+    p_tm[0].tm_hour = hour
+
+    p_tm[0].tm_gmtoff = o.offset * 60
+
+    return p_tm
+end
+
+local function asctime(o)
+    assert(ffi.typeof(o) == datetime_t)
+    local p_tm = datetime_to_tm_ptr(o)
     return ffi.string(native.asctime(p_tm))
 end
 
@@ -525,8 +544,7 @@ local function strftime(fmt, o)
     assert(ffi.typeof(o) == datetime_t)
     local sz = 50
     local buff = ffi.new('char[?]', sz)
-    local p_tm = ffi.new 'struct tm[1]'
-    cdt.dt_to_struct_tm(local_dt(o), p_tm)
+    local p_tm = datetime_to_tm_ptr(o)
     native.strftime(buff, sz, fmt, p_tm)
     return ffi.string(buff)
 end
diff --git a/test/unit/datetime.c b/test/unit/datetime.c
index 25c9c1f1a..f74ac139d 100644
--- a/test/unit/datetime.c
+++ b/test/unit/datetime.c
@@ -2,6 +2,7 @@
 #include <assert.h>
 #include <stdint.h>
 #include <string.h>
+#include <time.h>
 
 #include "unit.h"
 
@@ -125,6 +126,46 @@ parse_datetime(const char *str, size_t len, int64_t *sp, int64_t *np,
 	return 0;
 }
 
+// avoid introducing external datetime.h dependency
+// - just copy paste it for today
+#define SECS_PER_DAY      86400
+#define NANOS_PER_SEC     1000000000
+#define DT_EPOCH_1970_OFFSET 719163
+
+
+struct t_datetime_tz {
+	int64_t sec;
+	int64_t nsec;
+	int64_t offset;
+};
+
+static int
+local_rd(const struct t_datetime_tz * dt) {
+	return (int)(dt->sec / SECS_PER_DAY) + DT_EPOCH_1970_OFFSET;
+}
+
+static int
+local_dt(const struct t_datetime_tz * dt) {
+	return dt_from_rdn(local_rd(dt));
+}
+
+
+struct tm*
+datetime_to_tm(struct t_datetime_tz * dt)
+{
+	static struct tm tm;
+
+	memset(&tm, 0, sizeof(tm));
+	dt_to_struct_tm(local_dt(dt), &tm);
+
+	int seconds_of_day = dt->sec % 86400;
+	tm.tm_hour = (seconds_of_day / 3600) % 24;
+	tm.tm_min = (seconds_of_day / 60) % 60;
+	tm.tm_sec = seconds_of_day % 60;
+
+	return &tm;
+}
+
 static void datetime_test(void)
 {
 	size_t index;
@@ -132,7 +173,7 @@ static void datetime_test(void)
 	int64_t nanosecs;
 	int64_t ofs;
 
-	plan(132);
+	plan(330);
 	parse_datetime(sample, sizeof(sample) - 1,
 		       &secs_expected, &nanosecs, &ofs);
 
@@ -144,6 +185,19 @@ static void datetime_test(void)
 		   tests[index].sz);
 		is(secs, secs_expected, "correct parse_datetime output "
 		   "seconds for '%s", tests[index].sz);
+
+		// check that stringized literal produces the same date
+		// time fields
+		static char buff[40];
+		struct t_datetime_tz dt = {secs, nanosecs, ofs};
+		// datetime_to_tm returns time in GMT zone
+		struct tm * p_tm = datetime_to_tm(&dt);
+		size_t len = strftime(buff, sizeof buff, "%F %T%z", p_tm);
+		ok(len > 0, "strftime");
+		rc = parse_datetime(buff, len, &dt.sec, &dt.nsec, &dt.offset);
+		is(rc, 0, "correct parse_datetime return value for '%s'", buff);
+		is(secs, dt.sec,
+		   "reversible seconds via strftime for '%s", buff);
 	}
 }
 
diff --git a/test/unit/datetime.result b/test/unit/datetime.result
index 5cd68dea5..453897769 100644
--- a/test/unit/datetime.result
+++ b/test/unit/datetime.result
@@ -1,135 +1,333 @@
 1..1
-    1..132
+    1..330
     ok 1 - correct parse_datetime return value for '2012-12-24 15:30Z'
     ok 2 - correct parse_datetime output seconds for '2012-12-24 15:30Z
-    ok 3 - correct parse_datetime return value for '2012-12-24 15:30z'
-    ok 4 - correct parse_datetime output seconds for '2012-12-24 15:30z
-    ok 5 - correct parse_datetime return value for '2012-12-24 16:30+01:00'
-    ok 6 - correct parse_datetime output seconds for '2012-12-24 16:30+01:00
-    ok 7 - correct parse_datetime return value for '2012-12-24 16:30+0100'
-    ok 8 - correct parse_datetime output seconds for '2012-12-24 16:30+0100
-    ok 9 - correct parse_datetime return value for '2012-12-24 16:30+01'
-    ok 10 - correct parse_datetime output seconds for '2012-12-24 16:30+01
-    ok 11 - correct parse_datetime return value for '2012-12-24 14:30-01:00'
-    ok 12 - correct parse_datetime output seconds for '2012-12-24 14:30-01:00
-    ok 13 - correct parse_datetime return value for '2012-12-24 14:30-0100'
-    ok 14 - correct parse_datetime output seconds for '2012-12-24 14:30-0100
-    ok 15 - correct parse_datetime return value for '2012-12-24 14:30-01'
-    ok 16 - correct parse_datetime output seconds for '2012-12-24 14:30-01
-    ok 17 - correct parse_datetime return value for '2012-12-24 15:30:00Z'
-    ok 18 - correct parse_datetime output seconds for '2012-12-24 15:30:00Z
-    ok 19 - correct parse_datetime return value for '2012-12-24 15:30:00z'
-    ok 20 - correct parse_datetime output seconds for '2012-12-24 15:30:00z
-    ok 21 - correct parse_datetime return value for '2012-12-24 16:30:00+01:00'
-    ok 22 - correct parse_datetime output seconds for '2012-12-24 16:30:00+01:00
-    ok 23 - correct parse_datetime return value for '2012-12-24 16:30:00+0100'
-    ok 24 - correct parse_datetime output seconds for '2012-12-24 16:30:00+0100
-    ok 25 - correct parse_datetime return value for '2012-12-24 14:30:00-01:00'
-    ok 26 - correct parse_datetime output seconds for '2012-12-24 14:30:00-01:00
-    ok 27 - correct parse_datetime return value for '2012-12-24 14:30:00-0100'
-    ok 28 - correct parse_datetime output seconds for '2012-12-24 14:30:00-0100
-    ok 29 - correct parse_datetime return value for '2012-12-24 15:30:00.123456Z'
-    ok 30 - correct parse_datetime output seconds for '2012-12-24 15:30:00.123456Z
-    ok 31 - correct parse_datetime return value for '2012-12-24 15:30:00.123456z'
-    ok 32 - correct parse_datetime output seconds for '2012-12-24 15:30:00.123456z
-    ok 33 - correct parse_datetime return value for '2012-12-24 16:30:00.123456+01:00'
-    ok 34 - correct parse_datetime output seconds for '2012-12-24 16:30:00.123456+01:00
-    ok 35 - correct parse_datetime return value for '2012-12-24 16:30:00.123456+01'
-    ok 36 - correct parse_datetime output seconds for '2012-12-24 16:30:00.123456+01
-    ok 37 - correct parse_datetime return value for '2012-12-24 14:30:00.123456-01:00'
-    ok 38 - correct parse_datetime output seconds for '2012-12-24 14:30:00.123456-01:00
-    ok 39 - correct parse_datetime return value for '2012-12-24 14:30:00.123456-01'
-    ok 40 - correct parse_datetime output seconds for '2012-12-24 14:30:00.123456-01
-    ok 41 - correct parse_datetime return value for '2012-12-24t15:30Z'
-    ok 42 - correct parse_datetime output seconds for '2012-12-24t15:30Z
-    ok 43 - correct parse_datetime return value for '2012-12-24t15:30z'
-    ok 44 - correct parse_datetime output seconds for '2012-12-24t15:30z
-    ok 45 - correct parse_datetime return value for '2012-12-24t16:30+01:00'
-    ok 46 - correct parse_datetime output seconds for '2012-12-24t16:30+01:00
-    ok 47 - correct parse_datetime return value for '2012-12-24t16:30+0100'
-    ok 48 - correct parse_datetime output seconds for '2012-12-24t16:30+0100
-    ok 49 - correct parse_datetime return value for '2012-12-24t14:30-01:00'
-    ok 50 - correct parse_datetime output seconds for '2012-12-24t14:30-01:00
-    ok 51 - correct parse_datetime return value for '2012-12-24t14:30-0100'
-    ok 52 - correct parse_datetime output seconds for '2012-12-24t14:30-0100
-    ok 53 - correct parse_datetime return value for '2012-12-24t15:30:00Z'
-    ok 54 - correct parse_datetime output seconds for '2012-12-24t15:30:00Z
-    ok 55 - correct parse_datetime return value for '2012-12-24t15:30:00z'
-    ok 56 - correct parse_datetime output seconds for '2012-12-24t15:30:00z
-    ok 57 - correct parse_datetime return value for '2012-12-24t16:30:00+01:00'
-    ok 58 - correct parse_datetime output seconds for '2012-12-24t16:30:00+01:00
-    ok 59 - correct parse_datetime return value for '2012-12-24t16:30:00+0100'
-    ok 60 - correct parse_datetime output seconds for '2012-12-24t16:30:00+0100
-    ok 61 - correct parse_datetime return value for '2012-12-24t14:30:00-01:00'
-    ok 62 - correct parse_datetime output seconds for '2012-12-24t14:30:00-01:00
-    ok 63 - correct parse_datetime return value for '2012-12-24t14:30:00-0100'
-    ok 64 - correct parse_datetime output seconds for '2012-12-24t14:30:00-0100
-    ok 65 - correct parse_datetime return value for '2012-12-24t15:30:00.123456Z'
-    ok 66 - correct parse_datetime output seconds for '2012-12-24t15:30:00.123456Z
-    ok 67 - correct parse_datetime return value for '2012-12-24t15:30:00.123456z'
-    ok 68 - correct parse_datetime output seconds for '2012-12-24t15:30:00.123456z
-    ok 69 - correct parse_datetime return value for '2012-12-24t16:30:00.123456+01:00'
-    ok 70 - correct parse_datetime output seconds for '2012-12-24t16:30:00.123456+01:00
-    ok 71 - correct parse_datetime return value for '2012-12-24t14:30:00.123456-01:00'
-    ok 72 - correct parse_datetime output seconds for '2012-12-24t14:30:00.123456-01:00
-    ok 73 - correct parse_datetime return value for '2012-12-24 16:30 +01:00'
-    ok 74 - correct parse_datetime output seconds for '2012-12-24 16:30 +01:00
-    ok 75 - correct parse_datetime return value for '2012-12-24 14:30 -01:00'
-    ok 76 - correct parse_datetime output seconds for '2012-12-24 14:30 -01:00
-    ok 77 - correct parse_datetime return value for '2012-12-24 15:30 UTC'
-    ok 78 - correct parse_datetime output seconds for '2012-12-24 15:30 UTC
-    ok 79 - correct parse_datetime return value for '2012-12-24 16:30 UTC+1'
-    ok 80 - correct parse_datetime output seconds for '2012-12-24 16:30 UTC+1
-    ok 81 - correct parse_datetime return value for '2012-12-24 16:30 UTC+01'
-    ok 82 - correct parse_datetime output seconds for '2012-12-24 16:30 UTC+01
-    ok 83 - correct parse_datetime return value for '2012-12-24 16:30 UTC+0100'
-    ok 84 - correct parse_datetime output seconds for '2012-12-24 16:30 UTC+0100
-    ok 85 - correct parse_datetime return value for '2012-12-24 16:30 UTC+01:00'
-    ok 86 - correct parse_datetime output seconds for '2012-12-24 16:30 UTC+01:00
-    ok 87 - correct parse_datetime return value for '2012-12-24 14:30 UTC-1'
-    ok 88 - correct parse_datetime output seconds for '2012-12-24 14:30 UTC-1
-    ok 89 - correct parse_datetime return value for '2012-12-24 14:30 UTC-01'
-    ok 90 - correct parse_datetime output seconds for '2012-12-24 14:30 UTC-01
-    ok 91 - correct parse_datetime return value for '2012-12-24 14:30 UTC-01:00'
-    ok 92 - correct parse_datetime output seconds for '2012-12-24 14:30 UTC-01:00
-    ok 93 - correct parse_datetime return value for '2012-12-24 14:30 UTC-0100'
-    ok 94 - correct parse_datetime output seconds for '2012-12-24 14:30 UTC-0100
-    ok 95 - correct parse_datetime return value for '2012-12-24 15:30 GMT'
-    ok 96 - correct parse_datetime output seconds for '2012-12-24 15:30 GMT
-    ok 97 - correct parse_datetime return value for '2012-12-24 16:30 GMT+1'
-    ok 98 - correct parse_datetime output seconds for '2012-12-24 16:30 GMT+1
-    ok 99 - correct parse_datetime return value for '2012-12-24 16:30 GMT+01'
-    ok 100 - correct parse_datetime output seconds for '2012-12-24 16:30 GMT+01
-    ok 101 - correct parse_datetime return value for '2012-12-24 16:30 GMT+0100'
-    ok 102 - correct parse_datetime output seconds for '2012-12-24 16:30 GMT+0100
-    ok 103 - correct parse_datetime return value for '2012-12-24 16:30 GMT+01:00'
-    ok 104 - correct parse_datetime output seconds for '2012-12-24 16:30 GMT+01:00
-    ok 105 - correct parse_datetime return value for '2012-12-24 14:30 GMT-1'
-    ok 106 - correct parse_datetime output seconds for '2012-12-24 14:30 GMT-1
-    ok 107 - correct parse_datetime return value for '2012-12-24 14:30 GMT-01'
-    ok 108 - correct parse_datetime output seconds for '2012-12-24 14:30 GMT-01
-    ok 109 - correct parse_datetime return value for '2012-12-24 14:30 GMT-01:00'
-    ok 110 - correct parse_datetime output seconds for '2012-12-24 14:30 GMT-01:00
-    ok 111 - correct parse_datetime return value for '2012-12-24 14:30 GMT-0100'
-    ok 112 - correct parse_datetime output seconds for '2012-12-24 14:30 GMT-0100
-    ok 113 - correct parse_datetime return value for '2012-12-24 14:30 -01:00'
-    ok 114 - correct parse_datetime output seconds for '2012-12-24 14:30 -01:00
-    ok 115 - correct parse_datetime return value for '2012-12-24 16:30:00 +01:00'
-    ok 116 - correct parse_datetime output seconds for '2012-12-24 16:30:00 +01:00
-    ok 117 - correct parse_datetime return value for '2012-12-24 14:30:00 -01:00'
-    ok 118 - correct parse_datetime output seconds for '2012-12-24 14:30:00 -01:00
-    ok 119 - correct parse_datetime return value for '2012-12-24 16:30:00.123456 +01:00'
-    ok 120 - correct parse_datetime output seconds for '2012-12-24 16:30:00.123456 +01:00
-    ok 121 - correct parse_datetime return value for '2012-12-24 14:30:00.123456 -01:00'
-    ok 122 - correct parse_datetime output seconds for '2012-12-24 14:30:00.123456 -01:00
-    ok 123 - correct parse_datetime return value for '2012-12-24 15:30:00.123456 -00:00'
-    ok 124 - correct parse_datetime output seconds for '2012-12-24 15:30:00.123456 -00:00
-    ok 125 - correct parse_datetime return value for '20121224T1630+01:00'
-    ok 126 - correct parse_datetime output seconds for '20121224T1630+01:00
-    ok 127 - correct parse_datetime return value for '2012-12-24T1630+01:00'
-    ok 128 - correct parse_datetime output seconds for '2012-12-24T1630+01:00
-    ok 129 - correct parse_datetime return value for '20121224T16:30+01'
-    ok 130 - correct parse_datetime output seconds for '20121224T16:30+01
-    ok 131 - correct parse_datetime return value for '20121224T16:30 +01'
-    ok 132 - correct parse_datetime output seconds for '20121224T16:30 +01
+    ok 3 - strftime
+    ok 4 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 5 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 6 - correct parse_datetime return value for '2012-12-24 15:30z'
+    ok 7 - correct parse_datetime output seconds for '2012-12-24 15:30z
+    ok 8 - strftime
+    ok 9 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 10 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 11 - correct parse_datetime return value for '2012-12-24 16:30+01:00'
+    ok 12 - correct parse_datetime output seconds for '2012-12-24 16:30+01:00
+    ok 13 - strftime
+    ok 14 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 15 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 16 - correct parse_datetime return value for '2012-12-24 16:30+0100'
+    ok 17 - correct parse_datetime output seconds for '2012-12-24 16:30+0100
+    ok 18 - strftime
+    ok 19 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 20 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 21 - correct parse_datetime return value for '2012-12-24 16:30+01'
+    ok 22 - correct parse_datetime output seconds for '2012-12-24 16:30+01
+    ok 23 - strftime
+    ok 24 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 25 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 26 - correct parse_datetime return value for '2012-12-24 14:30-01:00'
+    ok 27 - correct parse_datetime output seconds for '2012-12-24 14:30-01:00
+    ok 28 - strftime
+    ok 29 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 30 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 31 - correct parse_datetime return value for '2012-12-24 14:30-0100'
+    ok 32 - correct parse_datetime output seconds for '2012-12-24 14:30-0100
+    ok 33 - strftime
+    ok 34 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 35 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 36 - correct parse_datetime return value for '2012-12-24 14:30-01'
+    ok 37 - correct parse_datetime output seconds for '2012-12-24 14:30-01
+    ok 38 - strftime
+    ok 39 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 40 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 41 - correct parse_datetime return value for '2012-12-24 15:30:00Z'
+    ok 42 - correct parse_datetime output seconds for '2012-12-24 15:30:00Z
+    ok 43 - strftime
+    ok 44 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 45 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 46 - correct parse_datetime return value for '2012-12-24 15:30:00z'
+    ok 47 - correct parse_datetime output seconds for '2012-12-24 15:30:00z
+    ok 48 - strftime
+    ok 49 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 50 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 51 - correct parse_datetime return value for '2012-12-24 16:30:00+01:00'
+    ok 52 - correct parse_datetime output seconds for '2012-12-24 16:30:00+01:00
+    ok 53 - strftime
+    ok 54 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 55 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 56 - correct parse_datetime return value for '2012-12-24 16:30:00+0100'
+    ok 57 - correct parse_datetime output seconds for '2012-12-24 16:30:00+0100
+    ok 58 - strftime
+    ok 59 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 60 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 61 - correct parse_datetime return value for '2012-12-24 14:30:00-01:00'
+    ok 62 - correct parse_datetime output seconds for '2012-12-24 14:30:00-01:00
+    ok 63 - strftime
+    ok 64 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 65 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 66 - correct parse_datetime return value for '2012-12-24 14:30:00-0100'
+    ok 67 - correct parse_datetime output seconds for '2012-12-24 14:30:00-0100
+    ok 68 - strftime
+    ok 69 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 70 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 71 - correct parse_datetime return value for '2012-12-24 15:30:00.123456Z'
+    ok 72 - correct parse_datetime output seconds for '2012-12-24 15:30:00.123456Z
+    ok 73 - strftime
+    ok 74 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 75 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 76 - correct parse_datetime return value for '2012-12-24 15:30:00.123456z'
+    ok 77 - correct parse_datetime output seconds for '2012-12-24 15:30:00.123456z
+    ok 78 - strftime
+    ok 79 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 80 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 81 - correct parse_datetime return value for '2012-12-24 16:30:00.123456+01:00'
+    ok 82 - correct parse_datetime output seconds for '2012-12-24 16:30:00.123456+01:00
+    ok 83 - strftime
+    ok 84 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 85 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 86 - correct parse_datetime return value for '2012-12-24 16:30:00.123456+01'
+    ok 87 - correct parse_datetime output seconds for '2012-12-24 16:30:00.123456+01
+    ok 88 - strftime
+    ok 89 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 90 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 91 - correct parse_datetime return value for '2012-12-24 14:30:00.123456-01:00'
+    ok 92 - correct parse_datetime output seconds for '2012-12-24 14:30:00.123456-01:00
+    ok 93 - strftime
+    ok 94 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 95 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 96 - correct parse_datetime return value for '2012-12-24 14:30:00.123456-01'
+    ok 97 - correct parse_datetime output seconds for '2012-12-24 14:30:00.123456-01
+    ok 98 - strftime
+    ok 99 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 100 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 101 - correct parse_datetime return value for '2012-12-24t15:30Z'
+    ok 102 - correct parse_datetime output seconds for '2012-12-24t15:30Z
+    ok 103 - strftime
+    ok 104 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 105 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 106 - correct parse_datetime return value for '2012-12-24t15:30z'
+    ok 107 - correct parse_datetime output seconds for '2012-12-24t15:30z
+    ok 108 - strftime
+    ok 109 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 110 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 111 - correct parse_datetime return value for '2012-12-24t16:30+01:00'
+    ok 112 - correct parse_datetime output seconds for '2012-12-24t16:30+01:00
+    ok 113 - strftime
+    ok 114 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 115 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 116 - correct parse_datetime return value for '2012-12-24t16:30+0100'
+    ok 117 - correct parse_datetime output seconds for '2012-12-24t16:30+0100
+    ok 118 - strftime
+    ok 119 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 120 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 121 - correct parse_datetime return value for '2012-12-24t14:30-01:00'
+    ok 122 - correct parse_datetime output seconds for '2012-12-24t14:30-01:00
+    ok 123 - strftime
+    ok 124 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 125 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 126 - correct parse_datetime return value for '2012-12-24t14:30-0100'
+    ok 127 - correct parse_datetime output seconds for '2012-12-24t14:30-0100
+    ok 128 - strftime
+    ok 129 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 130 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 131 - correct parse_datetime return value for '2012-12-24t15:30:00Z'
+    ok 132 - correct parse_datetime output seconds for '2012-12-24t15:30:00Z
+    ok 133 - strftime
+    ok 134 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 135 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 136 - correct parse_datetime return value for '2012-12-24t15:30:00z'
+    ok 137 - correct parse_datetime output seconds for '2012-12-24t15:30:00z
+    ok 138 - strftime
+    ok 139 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 140 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 141 - correct parse_datetime return value for '2012-12-24t16:30:00+01:00'
+    ok 142 - correct parse_datetime output seconds for '2012-12-24t16:30:00+01:00
+    ok 143 - strftime
+    ok 144 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 145 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 146 - correct parse_datetime return value for '2012-12-24t16:30:00+0100'
+    ok 147 - correct parse_datetime output seconds for '2012-12-24t16:30:00+0100
+    ok 148 - strftime
+    ok 149 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 150 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 151 - correct parse_datetime return value for '2012-12-24t14:30:00-01:00'
+    ok 152 - correct parse_datetime output seconds for '2012-12-24t14:30:00-01:00
+    ok 153 - strftime
+    ok 154 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 155 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 156 - correct parse_datetime return value for '2012-12-24t14:30:00-0100'
+    ok 157 - correct parse_datetime output seconds for '2012-12-24t14:30:00-0100
+    ok 158 - strftime
+    ok 159 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 160 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 161 - correct parse_datetime return value for '2012-12-24t15:30:00.123456Z'
+    ok 162 - correct parse_datetime output seconds for '2012-12-24t15:30:00.123456Z
+    ok 163 - strftime
+    ok 164 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 165 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 166 - correct parse_datetime return value for '2012-12-24t15:30:00.123456z'
+    ok 167 - correct parse_datetime output seconds for '2012-12-24t15:30:00.123456z
+    ok 168 - strftime
+    ok 169 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 170 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 171 - correct parse_datetime return value for '2012-12-24t16:30:00.123456+01:00'
+    ok 172 - correct parse_datetime output seconds for '2012-12-24t16:30:00.123456+01:00
+    ok 173 - strftime
+    ok 174 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 175 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 176 - correct parse_datetime return value for '2012-12-24t14:30:00.123456-01:00'
+    ok 177 - correct parse_datetime output seconds for '2012-12-24t14:30:00.123456-01:00
+    ok 178 - strftime
+    ok 179 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 180 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 181 - correct parse_datetime return value for '2012-12-24 16:30 +01:00'
+    ok 182 - correct parse_datetime output seconds for '2012-12-24 16:30 +01:00
+    ok 183 - strftime
+    ok 184 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 185 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 186 - correct parse_datetime return value for '2012-12-24 14:30 -01:00'
+    ok 187 - correct parse_datetime output seconds for '2012-12-24 14:30 -01:00
+    ok 188 - strftime
+    ok 189 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 190 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 191 - correct parse_datetime return value for '2012-12-24 15:30 UTC'
+    ok 192 - correct parse_datetime output seconds for '2012-12-24 15:30 UTC
+    ok 193 - strftime
+    ok 194 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 195 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 196 - correct parse_datetime return value for '2012-12-24 16:30 UTC+1'
+    ok 197 - correct parse_datetime output seconds for '2012-12-24 16:30 UTC+1
+    ok 198 - strftime
+    ok 199 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 200 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 201 - correct parse_datetime return value for '2012-12-24 16:30 UTC+01'
+    ok 202 - correct parse_datetime output seconds for '2012-12-24 16:30 UTC+01
+    ok 203 - strftime
+    ok 204 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 205 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 206 - correct parse_datetime return value for '2012-12-24 16:30 UTC+0100'
+    ok 207 - correct parse_datetime output seconds for '2012-12-24 16:30 UTC+0100
+    ok 208 - strftime
+    ok 209 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 210 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 211 - correct parse_datetime return value for '2012-12-24 16:30 UTC+01:00'
+    ok 212 - correct parse_datetime output seconds for '2012-12-24 16:30 UTC+01:00
+    ok 213 - strftime
+    ok 214 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 215 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 216 - correct parse_datetime return value for '2012-12-24 14:30 UTC-1'
+    ok 217 - correct parse_datetime output seconds for '2012-12-24 14:30 UTC-1
+    ok 218 - strftime
+    ok 219 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 220 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 221 - correct parse_datetime return value for '2012-12-24 14:30 UTC-01'
+    ok 222 - correct parse_datetime output seconds for '2012-12-24 14:30 UTC-01
+    ok 223 - strftime
+    ok 224 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 225 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 226 - correct parse_datetime return value for '2012-12-24 14:30 UTC-01:00'
+    ok 227 - correct parse_datetime output seconds for '2012-12-24 14:30 UTC-01:00
+    ok 228 - strftime
+    ok 229 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 230 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 231 - correct parse_datetime return value for '2012-12-24 14:30 UTC-0100'
+    ok 232 - correct parse_datetime output seconds for '2012-12-24 14:30 UTC-0100
+    ok 233 - strftime
+    ok 234 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 235 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 236 - correct parse_datetime return value for '2012-12-24 15:30 GMT'
+    ok 237 - correct parse_datetime output seconds for '2012-12-24 15:30 GMT
+    ok 238 - strftime
+    ok 239 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 240 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 241 - correct parse_datetime return value for '2012-12-24 16:30 GMT+1'
+    ok 242 - correct parse_datetime output seconds for '2012-12-24 16:30 GMT+1
+    ok 243 - strftime
+    ok 244 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 245 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 246 - correct parse_datetime return value for '2012-12-24 16:30 GMT+01'
+    ok 247 - correct parse_datetime output seconds for '2012-12-24 16:30 GMT+01
+    ok 248 - strftime
+    ok 249 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 250 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 251 - correct parse_datetime return value for '2012-12-24 16:30 GMT+0100'
+    ok 252 - correct parse_datetime output seconds for '2012-12-24 16:30 GMT+0100
+    ok 253 - strftime
+    ok 254 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 255 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 256 - correct parse_datetime return value for '2012-12-24 16:30 GMT+01:00'
+    ok 257 - correct parse_datetime output seconds for '2012-12-24 16:30 GMT+01:00
+    ok 258 - strftime
+    ok 259 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 260 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 261 - correct parse_datetime return value for '2012-12-24 14:30 GMT-1'
+    ok 262 - correct parse_datetime output seconds for '2012-12-24 14:30 GMT-1
+    ok 263 - strftime
+    ok 264 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 265 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 266 - correct parse_datetime return value for '2012-12-24 14:30 GMT-01'
+    ok 267 - correct parse_datetime output seconds for '2012-12-24 14:30 GMT-01
+    ok 268 - strftime
+    ok 269 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 270 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 271 - correct parse_datetime return value for '2012-12-24 14:30 GMT-01:00'
+    ok 272 - correct parse_datetime output seconds for '2012-12-24 14:30 GMT-01:00
+    ok 273 - strftime
+    ok 274 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 275 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 276 - correct parse_datetime return value for '2012-12-24 14:30 GMT-0100'
+    ok 277 - correct parse_datetime output seconds for '2012-12-24 14:30 GMT-0100
+    ok 278 - strftime
+    ok 279 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 280 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 281 - correct parse_datetime return value for '2012-12-24 14:30 -01:00'
+    ok 282 - correct parse_datetime output seconds for '2012-12-24 14:30 -01:00
+    ok 283 - strftime
+    ok 284 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 285 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 286 - correct parse_datetime return value for '2012-12-24 16:30:00 +01:00'
+    ok 287 - correct parse_datetime output seconds for '2012-12-24 16:30:00 +01:00
+    ok 288 - strftime
+    ok 289 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 290 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 291 - correct parse_datetime return value for '2012-12-24 14:30:00 -01:00'
+    ok 292 - correct parse_datetime output seconds for '2012-12-24 14:30:00 -01:00
+    ok 293 - strftime
+    ok 294 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 295 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 296 - correct parse_datetime return value for '2012-12-24 16:30:00.123456 +01:00'
+    ok 297 - correct parse_datetime output seconds for '2012-12-24 16:30:00.123456 +01:00
+    ok 298 - strftime
+    ok 299 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 300 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 301 - correct parse_datetime return value for '2012-12-24 14:30:00.123456 -01:00'
+    ok 302 - correct parse_datetime output seconds for '2012-12-24 14:30:00.123456 -01:00
+    ok 303 - strftime
+    ok 304 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 305 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 306 - correct parse_datetime return value for '2012-12-24 15:30:00.123456 -00:00'
+    ok 307 - correct parse_datetime output seconds for '2012-12-24 15:30:00.123456 -00:00
+    ok 308 - strftime
+    ok 309 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 310 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 311 - correct parse_datetime return value for '20121224T1630+01:00'
+    ok 312 - correct parse_datetime output seconds for '20121224T1630+01:00
+    ok 313 - strftime
+    ok 314 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 315 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 316 - correct parse_datetime return value for '2012-12-24T1630+01:00'
+    ok 317 - correct parse_datetime output seconds for '2012-12-24T1630+01:00
+    ok 318 - strftime
+    ok 319 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 320 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 321 - correct parse_datetime return value for '20121224T16:30+01'
+    ok 322 - correct parse_datetime output seconds for '20121224T16:30+01
+    ok 323 - strftime
+    ok 324 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 325 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
+    ok 326 - correct parse_datetime return value for '20121224T16:30 +01'
+    ok 327 - correct parse_datetime output seconds for '20121224T16:30 +01
+    ok 328 - strftime
+    ok 329 - correct parse_datetime return value for '2012-12-24 15:30:00+0000'
+    ok 330 - reversible seconds via strftime for '2012-12-24 15:30:00+0000
 ok 1 - subtests
-- 
2.29.2



More information about the Tarantool-patches mailing list