From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id D599A6EC55; Thu, 15 Jul 2021 11:22:22 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D599A6EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1626337342; bh=/paUVwk6Jbd1/nE+kAYcFsY81dFSAdr4zUt2Awtio5s=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=MWhFdj+XrWcZnvJybzL+jBykeO5LStFuNGJVeaYK8MUAu0qoKpnl7EIdz8H7CcWEC 3hLbBYcSYoEtOftHBdg+FN9GvPgyCtE/OqqJGb9FPcBLNPLCgQJ0qsQf2XX4U66qCF xFBuvMg+uOybSP759tSOkn/OPlmOqOGiR2Ws2nDA= Received: from smtp57.i.mail.ru (smtp57.i.mail.ru [217.69.128.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id BBD616EC6E for ; Thu, 15 Jul 2021 11:18:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org BBD616EC6E Received: by smtp57.i.mail.ru with esmtpa (envelope-from ) id 1m3wa8-00070N-2m; Thu, 15 Jul 2021 11:18:56 +0300 To: v.shpilevoy@tarantool.org Date: Thu, 15 Jul 2021 11:18:13 +0300 Message-Id: <9ef1ca61e20909fcf623f59d07b4e3d4a9e87217.1626335241.git.tsafin@tarantool.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD941C43E597735A9C36A98DBA789EBB6AEAF05AC269C48884F182A05F538085040ECE9E3CADD2AA55047C42A5C0DD4E2C9605EE98FFA6906F77688A2BEE7EB943B X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE71BDE6A359BD5B800EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006377CB294AC37272EBD8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D866911D25B5B47FEDE8E2EEE3E151733C117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCF1175FABE1C0F9B6A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18C26CFBAC0749D213D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE7B96B19DC40933213DBBCB839D0549ACD8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE31DAA61796BF5227BBA3038C0950A5D36B5C8C57E37DE458B0BC6067A898B09E46D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE75A9E79F66F1C28F3731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975CE68746B1F2AB10C6D3CE40049E15A76FC4D573810A23CC3D9C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EF3033054805BDE987699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34E54F8089C01448AA1BAB716653CE98E5B831298204D1856744D24A00B4D1F8AB6736500C847DAB4B1D7E09C32AA3244CE9558FB60B4E05E862854E7AD966206C3E8609A02908F27183B48618A63566E0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojbL9S8ysBdXjnYxxC9kpVb8FCexfXYXdS X-Mailru-Sender: B5B6A6EBBD94DAD8DA84A184D75F19DB2E7B7B20C3E75D0F97B4321C410DDED71737084CF7E8581F1EC9E4A2C82A33BC8C24925A86E657CE0C70AEE3C9A96FBAB3D7EE8ED63280BE112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: [Tarantool-patches] [RFC PATCH 07/13] lua: asctime and strfime fixed X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Timur Safin via Tarantool-patches Reply-To: Timur Safin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" * 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 #include #include +#include #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