Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q2W2a-0003s6-43 for pgsql-bugs@arkaria.postgresql.org; Fri, 26 May 2023 11:55:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q2W2X-0005Uc-Dd for pgsql-bugs@arkaria.postgresql.org; Fri, 26 May 2023 11:55:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q2MNg-0002n3-3i for pgsql-bugs@lists.postgresql.org; Fri, 26 May 2023 01:36:36 +0000 Received: from mohiohio.com ([101.100.140.65]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q2MNb-001upQ-Do for pgsql-bugs@lists.postgresql.org; Fri, 26 May 2023 01:36:33 +0000 From: Tim Field DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mohiohio.com; s=mail; t=1685064985; bh=6H34WyWPCDL2wcVix6nwV0wAvMeShpWgNYmPUAEvOYM=; h=From:Subject:To; b=LAveBmYMThaEQgScpNJJHSLfd7k1X1DPrPVxH6a1pCbOx+mozoh0EAWmnkrmUR3sT B95BL01+2qygifunobaBsjgjQJMGo+ntQLKlUbf+BHyNfnYvGBQzuRNwf+/Ym2iHie ey4pwPs1+daA8FakfBai7lZN4u50mY5xqJ/r2AmW4IJn5yeRIU8VaQw5gfRnnMIANv H9JmW6b2gfwz72qkK8cKKOh5G3cPl93jWpffOe18QGWu6zr274wQ18exrxnYj7anzF a3yfeZ/Wc2X3T90y6iVt0lT6GQ0xLZ0o3BwDc7bAx+E0d/IaE3MEPsiobYXwognd9d xD5O8K1g4eIKK/MA3jT8ZiWAUz+m+JAGS4kvdhyO+vJ3rujRJ2nmDY9qegbIABMMTf 6XWLZcGRPafZoO2cu8MTfZx6V/B5u7W1Xjfkjgzbrjo5btrgWm30SzNjOOCcoWzHc5 pY+vdZIuhhevXWsJmx9gYYAyskjOUn1e54K9a3oyNegnNW9xS3h6+hzuhbrnANKFbQ Z0WhVXOjz+3p8NAPrFeXlz+iMxmAfgGggqzf2lxH4fdDQqNutBkk/mxoTZ1PAftczv pf6f3R/7qfB4qHzRqCDpHStrTANXLYFyUaocXi/TaHsBwhC13ka8v4fLjUP7/vHkwV zcf8JFb/MhOXYSizmEceDN6E= Content-Type: multipart/alternative; boundary="Apple-Mail=_F8A5D38F-033F-475F-9D9E-9B693B030057" MIME-Version: 1.0 Subject: Comparing date strings with jsonpath expression Message-Id: <014A028B-5CE6-4FDF-AC24-426CA6FC9CEE@mohiohio.com> Date: Fri, 26 May 2023 13:36:14 +1200 To: pgsql-bugs@lists.postgresql.org List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_F8A5D38F-033F-475F-9D9E-9B693B030057 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 When using .datetime() in jsonpath expressions JSON encoded dates are = not parsed, this is coupled with the fact that an error isn=E2=80=99t = reported. I would expect that any date encoded via JSON.stringify() would be = parseable in these JSON path functions as that is after all the format = that dates are very likely to be in. If I JSON encode a date I get a value such as = "2023-05-22T03:09:37.825Z=E2=80=9D .datetime() fails to parse this due = to the mircosends and timezone indicator, yet its possible to convert = that with=20 "2023-05-22T03:09:37.825Z=E2=80=9D::timestamptz=20 Example here of the issue, and a stackoverflow post with further = discussion. https://dbfiddle.uk/PzW0WOvV = https://stackoverflow.com/questions/76319993/comparing-date-strings-with-j= sonpath-expression=EF=BF=BC Comparing date strings with jsonpath expression stackoverflow.com= --Apple-Mail=_F8A5D38F-033F-475F-9D9E-9B693B030057 Content-Type: multipart/related; type="text/html"; boundary="Apple-Mail=_7A17F091-514B-491C-A2BD-023032389C84" --Apple-Mail=_7A17F091-514B-491C-A2BD-023032389C84 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
When using .datetime() in jsonpath expressions = JSON encoded dates are not parsed, this is coupled with the fact that an = error isn=E2=80=99t reported.

I would expect that any = date encoded via JSON.stringify() would be parseable in these JSON path = functions as that is after all the format that dates are very likely to = be in.

If I JSON encode a date I get a value such as = "2023-05-22T03:09:37.825Z=E2=80=9D .datetime() fails to parse this due = to the mircosends and timezone indicator, yet its possible to convert = that with 
"2023-05-22T03:09:37.825Z=E2=80=9D::timestamptz 

Example here of the issue, and a stackoverflow post with further = discussion.