local t = require('luatest')
local dt = require('datetime')

local SUPPORTED_DATETIME_FORMATS = {
    ['RFC3339 AND ISO8601'] = {
        -- Dates.
        {
            fmt = '%Y-%M-%D',
            buf = '2024-07-31',
        },
        -- Date-Times.
        {
            fmt = '%Y-%M-%DT%h:%m:%sZ',
            buf = '2024-07-31T14:30:02Z',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%.1sZ',
            buf = '2024-07-31T14:30:02.1Z',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%.2sZ',
            buf = '2024-07-31T14:30:02.13Z',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%.3sZ',
            buf = '2024-07-31T14:30:02.132Z',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%s.%uZ',
            buf = '2024-07-31T14:30:02.132209Z',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%s%Z:%z',
            buf = '2024-07-31T17:30:02+03:00',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%.3s%Z:%z',
            buf = '2024-07-31T17:30:02.132+03:00',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%s.%u%Z:%z',
            buf = '2024-07-31T17:30:02.132209+03:00',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%s+08:45',
            buf = '2024-07-31T23:15:02+08:45',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%s+00:00',
            buf = '2024-07-31T14:30:02+00:00',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%.3s+00:00',
            buf = '2024-07-31T14:30:02.132+00:00',
        },
    },

    ['RFC3339 ONLY'] = {
        -- Dates-Times.
        {
            fmt = '%Y-%M-%Dt%h:%m:%sz',
            buf = '2024-07-31t14:30:02z',
        }, {
            fmt = '%Y-%M-%Dt%h:%m:%.3sz',
            buf = '2024-07-31t14:30:02.132z',
        }, {
            fmt = '%Y-%M-%D %h:%m:%s%Z:%z',
            buf = '2024-07-31 17:30:02+03:00',
        }, {
            fmt = '%Y-%M-%D %h:%m:%.1s%Z:%z',
            buf = '2024-07-31 17:30:02.1+03:00',
        }, {
            fmt = '%Y-%M-%D %h:%m:%.2s%Z:%z',
            buf = '2024-07-31 17:30:02.13+03:00',
        }, {
            fmt = '%Y-%M-%D %h:%m:%.3s%Z:%z',
            buf = '2024-07-31 17:30:02.132+03:00',
        }, {
            fmt = '%Y-%M-%D %h:%m:%s.%u%Z:%z',
            buf = '2024-07-31 17:30:02.132209+03:00',
        }, {
            fmt = '%Y-%M-%D %h:%m:%sZ',
            buf = '2024-07-31 14:30:02Z',
        }, {
            fmt = '%Y-%M-%D %h:%m:%sz',
            buf = '2024-07-31 14:30:02z',
        }, {
            fmt = '%Y-%M-%D %h:%m:%.1sZ',
            buf = '2024-07-31 14:30:02.1Z',
        }, {
            fmt = '%Y-%M-%D %h:%m:%.2sZ',
            buf = '2024-07-31 14:30:02.13Z',
        }, {
            fmt = '%Y-%M-%D %h:%m:%.3sZ',
            buf = '2024-07-31 14:30:02.132Z',
        }, {
            fmt = '%Y-%M-%D %h:%m:%s.%uZ',
            buf = '2024-07-31 14:30:02.132209Z',
        }, {
            fmt = '%Y-%M-%D %h:%m:%.3sz',
            buf = '2024-07-31 14:30:02.132z',
        }, {
            fmt = '%Y-%M-%D %h:%m:%s.%uz',
            buf = '2024-07-31 14:30:02.132209z',
        }, {
            fmt = '%Y-%M-%D %h:%m:%s-00:00',
            buf = '2024-07-31 14:30:02-00:00',
        }, {
            fmt = '%Y-%M-%D %h:%m:%.3s-00:00',
            buf = '2024-07-31 14:30:02.132-00:00',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%s-00:00',
            buf = '2024-07-31T14:30:02-00:00',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%.3s-00:00',
            buf = '2024-07-31T14:30:02.132-00:00',
        },
    },

    ['ISO8601 ONLY'] = {
        -- Dates.
        {
            fmt = '%Y-%O',
            buf = '2024-213',
        }, {
            fmt = '%V-W%W-%w',
            buf = '2024-W31-3',
        }, {
            fmt = '%Y%M%D',
            buf = '20240731',
        }, {
            fmt = '%Y%O',
            buf = '2024213',
        }, {
            fmt = '%VW%W%w',
            buf = '2024W313',
        },
        -- Dates-Times.
        {
            fmt = '%Y-%M-%DT%h',
            buf = '2024-07-31T17',
        }, {
            fmt = '%Y-%M-%DT%,1h',
            buf = '2024-07-31T17,5',
        }, {
            fmt = '%Y-%M-%DT%.1h',
            buf = '2024-07-31T17.5',
        }, {
            fmt = '%Y-%M-%DT%h:%m',
            buf = '2024-07-31T17:30',
        }, {
            fmt = '%Y-%M-%DT%h:%,1m',
            buf = '2024-07-31T17:30,0',
        }, {
            fmt = '%Y-%M-%DT%h:%.1m',
            buf = '2024-07-31T17:30.0',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%s',
            buf = '2024-07-31T17:30:02',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%.1s',
            buf = '2024-07-31T17:30:02.1',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%.2s',
            buf = '2024-07-31T17:30:02.13',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%,3s',
            buf = '2024-07-31T17:30:02,132',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%.3s',
            buf = '2024-07-31T17:30:02.132',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%s,%u',
            buf = '2024-07-31T17:30:02,132209',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%s.%u',
            buf = '2024-07-31T17:30:02.132209',
        }, {
            fmt = '%Y-%M-%DT%hZ',
            buf = '2024-07-31T14Z',
        }, {
            fmt = '%Y-%M-%DT%,1hZ',
            buf = '2024-07-31T14,5Z',
        }, {
            fmt = '%Y-%M-%DT%.1hZ',
            buf = '2024-07-31T14.5Z',
        }, {
            fmt = '%Y-%M-%DT%h:%mZ',
            buf = '2024-07-31T14:30Z',
        }, {
            fmt = '%Y-%M-%DT%h:%,1mZ',
            buf = '2024-07-31T14:30,0Z',
        }, {
            fmt = '%Y-%M-%DT%h:%.1mZ',
            buf = '2024-07-31T14:30.0Z',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%,3sZ',
            buf = '2024-07-31T14:30:02,132Z',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%s,%uZ',
            buf = '2024-07-31T14:30:02,132209Z',
        }, {
            fmt = '%Y-%M-%DT%h%Z',
            buf = '2024-07-31T17+03',
        }, {
            fmt = '%Y-%M-%DT%,1h%Z',
            buf = '2024-07-31T17,5+03',
        }, {
            fmt = '%Y-%M-%DT%.1h%Z',
            buf = '2024-07-31T17.5+03',
        }, {
            fmt = '%Y-%M-%DT%h:%m%Z',
            buf = '2024-07-31T17:30+03',
        }, {
            fmt = '%Y-%M-%DT%h:%,1m%Z',
            buf = '2024-07-31T17:30,0+03',
        }, {
            fmt = '%Y-%M-%DT%h:%.1m%Z',
            buf = '2024-07-31T17:30.0+03',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%s%Z',
            buf = '2024-07-31T17:30:02+03',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%.1s%Z',
            buf = '2024-07-31T17:30:02.1+03',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%.2s%Z',
            buf = '2024-07-31T17:30:02.13+03',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%,3s%Z',
            buf = '2024-07-31T17:30:02,132+03',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%.3s%Z',
            buf = '2024-07-31T17:30:02.132+03',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%s,%u%Z',
            buf = '2024-07-31T17:30:02,132209+03',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%s.%u%Z',
            buf = '2024-07-31T17:30:02.132209+03',
        }, {
            fmt = '%Y-%M-%DT%h%Z:%z',
            buf = '2024-07-31T17+03:00',
        }, {
            fmt = '%Y-%M-%DT%,1h%Z:%z',
            buf = '2024-07-31T17,5+03:00',
        }, {
            fmt = '%Y-%M-%DT%.1h%Z:%z',
            buf = '2024-07-31T17.5+03:00',
        }, {
            fmt = '%Y-%M-%DT%h:%m%Z:%z',
            buf = '2024-07-31T17:30+03:00',
        }, {
            fmt = '%Y-%M-%DT%h:%,1m%Z:%z',
            buf = '2024-07-31T17:30,0+03:00',
        }, {
            fmt = '%Y-%M-%DT%h:%.1m%Z:%z',
            buf = '2024-07-31T17:30.0+03:00',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%.1s%Z:%z',
            buf = '2024-07-31T17:30:02.1+03:00',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%.2s%Z:%z',
            buf = '2024-07-31T17:30:02.13+03:00',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%,3s%Z:%z',
            buf = '2024-07-31T17:30:02,132+03:00',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%s,%u%Z:%z',
            buf = '2024-07-31T17:30:02,132209+03:00',
        }, {
            fmt = '%V-W%W-%wT%h',
            buf = '2024-W31-3T17',
        }, {
            fmt = '%V-W%W-%wT%,1h',
            buf = '2024-W31-3T17,5',
        }, {
            fmt = '%V-W%W-%wT%.1h',
            buf = '2024-W31-3T17.5',
        }, {
            fmt = '%V-W%W-%wT%h:%m',
            buf = '2024-W31-3T17:30',
        }, {
            fmt = '%V-W%W-%wT%h:%,1m',
            buf = '2024-W31-3T17:30,0',
        }, {
            fmt = '%V-W%W-%wT%h:%.1m',
            buf = '2024-W31-3T17:30.0',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%s',
            buf = '2024-W31-3T17:30:02',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%.1s',
            buf = '2024-W31-3T17:30:02.1',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%.2s',
            buf = '2024-W31-3T17:30:02.13',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%,3s',
            buf = '2024-W31-3T17:30:02,132',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%.3s',
            buf = '2024-W31-3T17:30:02.132',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%s,%u',
            buf = '2024-W31-3T17:30:02,132209',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%s.%u',
            buf = '2024-W31-3T17:30:02.132209',
        }, {
            fmt = '%V-W%W-%wT%hZ',
            buf = '2024-W31-3T14Z',
        }, {
            fmt = '%V-W%W-%wT%,1hZ',
            buf = '2024-W31-3T14,5Z',
        }, {
            fmt = '%V-W%W-%wT%.1hZ',
            buf = '2024-W31-3T14.5Z',
        }, {
            fmt = '%V-W%W-%wT%h:%mZ',
            buf = '2024-W31-3T14:30Z',
        }, {
            fmt = '%V-W%W-%wT%h:%,1mZ',
            buf = '2024-W31-3T14:30,0Z',
        }, {
            fmt = '%V-W%W-%wT%h:%.1mZ',
            buf = '2024-W31-3T14:30.0Z',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%sZ',
            buf = '2024-W31-3T14:30:02Z',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%.1sZ',
            buf = '2024-W31-3T14:30:02.1Z',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%.2sZ',
            buf = '2024-W31-3T14:30:02.13Z',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%,3sZ',
            buf = '2024-W31-3T14:30:02,132Z',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%.3sZ',
            buf = '2024-W31-3T14:30:02.132Z',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%s,%uZ',
            buf = '2024-W31-3T14:30:02,132209Z',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%s.%uZ',
            buf = '2024-W31-3T14:30:02.132209Z',
        }, {
            fmt = '%V-W%W-%wT%h%Z',
            buf = '2024-W31-3T17+03',
        }, {
            fmt = '%V-W%W-%wT%,1h%Z',
            buf = '2024-W31-3T17,5+03',
        }, {
            fmt = '%V-W%W-%wT%.1h%Z',
            buf = '2024-W31-3T17.5+03',
        }, {
            fmt = '%V-W%W-%wT%h:%m%Z',
            buf = '2024-W31-3T17:30+03',
        }, {
            fmt = '%V-W%W-%wT%h:%,1m%Z',
            buf = '2024-W31-3T17:30,0+03',
        }, {
            fmt = '%V-W%W-%wT%h:%.1m%Z',
            buf = '2024-W31-3T17:30.0+03',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%s%Z',
            buf = '2024-W31-3T17:30:02+03',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%.1s%Z',
            buf = '2024-W31-3T17:30:02.1+03',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%.2s%Z',
            buf = '2024-W31-3T17:30:02.13+03',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%,3s%Z',
            buf = '2024-W31-3T17:30:02,132+03',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%.3s%Z',
            buf = '2024-W31-3T17:30:02.132+03',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%s,%u%Z',
            buf = '2024-W31-3T17:30:02,132209+03',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%s.%u%Z',
            buf = '2024-W31-3T17:30:02.132209+03',
        }, {
            fmt = '%V-W%W-%wT%h%Z:%z',
            buf = '2024-W31-3T17+03:00',
        }, {
            fmt = '%V-W%W-%wT%,1h%Z:%z',
            buf = '2024-W31-3T17,5+03:00',
        }, {
            fmt = '%V-W%W-%wT%.1h%Z:%z',
            buf = '2024-W31-3T17.5+03:00',
        }, {
            fmt = '%V-W%W-%wT%h:%m%Z:%z',
            buf = '2024-W31-3T17:30+03:00',
        }, {
            fmt = '%V-W%W-%wT%h:%,1m%Z:%z',
            buf = '2024-W31-3T17:30,0+03:00',
        }, {
            fmt = '%V-W%W-%wT%h:%.1m%Z:%z',
            buf = '2024-W31-3T17:30.0+03:00',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%s%Z:%z',
            buf = '2024-W31-3T17:30:02+03:00',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%.1s%Z:%z',
            buf = '2024-W31-3T17:30:02.1+03:00',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%.2s%Z:%z',
            buf = '2024-W31-3T17:30:02.13+03:00',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%,3s%Z:%z',
            buf = '2024-W31-3T17:30:02,132+03:00',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%.3s%Z:%z',
            buf = '2024-W31-3T17:30:02.132+03:00',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%s,%u%Z:%z',
            buf = '2024-W31-3T17:30:02,132209+03:00',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%s.%u%Z:%z',
            buf = '2024-W31-3T17:30:02.132209+03:00',
        }, {
            fmt = '%Y-%OT%h',
            buf = '2024-213T17',
        }, {
            fmt = '%Y-%OT%,1h',
            buf = '2024-213T17,5',
        }, {
            fmt = '%Y-%OT%.1h',
            buf = '2024-213T17.5',
        }, {
            fmt = '%Y-%OT%h:%m',
            buf = '2024-213T17:30',
        }, {
            fmt = '%Y-%OT%h:%,1m',
            buf = '2024-213T17:30,0',
        }, {
            fmt = '%Y-%OT%h:%.1m',
            buf = '2024-213T17:30.0',
        }, {
            fmt = '%Y-%OT%h:%m:%s',
            buf = '2024-213T17:30:02',
        }, {
            fmt = '%Y-%OT%h:%m:%.1s',
            buf = '2024-213T17:30:02.1',
        }, {
            fmt = '%Y-%OT%h:%m:%.2s',
            buf = '2024-213T17:30:02.13',
        }, {
            fmt = '%Y-%OT%h:%m:%,3s',
            buf = '2024-213T17:30:02,132',
        }, {
            fmt = '%Y-%OT%h:%m:%.3s',
            buf = '2024-213T17:30:02.132',
        }, {
            fmt = '%Y-%OT%h:%m:%s,%u',
            buf = '2024-213T17:30:02,132209',
        }, {
            fmt = '%Y-%OT%h:%m:%s.%u',
            buf = '2024-213T17:30:02.132209',
        }, {
            fmt = '%Y-%OT%hZ',
            buf = '2024-213T14Z',
        }, {
            fmt = '%Y-%OT%,1hZ',
            buf = '2024-213T14,5Z',
        }, {
            fmt = '%Y-%OT%.1hZ',
            buf = '2024-213T14.5Z',
        }, {
            fmt = '%Y-%OT%h:%mZ',
            buf = '2024-213T14:30Z',
        }, {
            fmt = '%Y-%OT%h:%,1mZ',
            buf = '2024-213T14:30,0Z',
        }, {
            fmt = '%Y-%OT%h:%.1mZ',
            buf = '2024-213T14:30.0Z',
        }, {
            fmt = '%Y-%OT%h:%m:%sZ',
            buf = '2024-213T14:30:02Z',
        }, {
            fmt = '%Y-%OT%h:%m:%.1sZ',
            buf = '2024-213T14:30:02.1Z',
        }, {
            fmt = '%Y-%OT%h:%m:%.2sZ',
            buf = '2024-213T14:30:02.13Z',
        }, {
            fmt = '%Y-%OT%h:%m:%,3sZ',
            buf = '2024-213T14:30:02,132Z',
        }, {
            fmt = '%Y-%OT%h:%m:%.3sZ',
            buf = '2024-213T14:30:02.132Z',
        }, {
            fmt = '%Y-%OT%h:%m:%s,%uZ',
            buf = '2024-213T14:30:02,132209Z',
        }, {
            fmt = '%Y-%OT%h:%m:%s.%uZ',
            buf = '2024-213T14:30:02.132209Z',
        }, {
            fmt = '%Y-%OT%h%Z',
            buf = '2024-213T17+03',
        }, {
            fmt = '%Y-%OT%,1h%Z',
            buf = '2024-213T17,5+03',
        }, {
            fmt = '%Y-%OT%.1h%Z',
            buf = '2024-213T17.5+03',
        }, {
            fmt = '%Y-%OT%h:%m%Z',
            buf = '2024-213T17:30+03',
        }, {
            fmt = '%Y-%OT%h:%,1m%Z',
            buf = '2024-213T17:30,0+03',
        }, {
            fmt = '%Y-%OT%h:%.1m%Z',
            buf = '2024-213T17:30.0+03',
        }, {
            fmt = '%Y-%OT%h:%m:%s%Z',
            buf = '2024-213T17:30:02+03',
        }, {
            fmt = '%Y-%OT%h:%m:%.1s%Z',
            buf = '2024-213T17:30:02.1+03',
        }, {
            fmt = '%Y-%OT%h:%m:%.2s%Z',
            buf = '2024-213T17:30:02.13+03',
        }, {
            fmt = '%Y-%OT%h:%m:%,3s%Z',
            buf = '2024-213T17:30:02,132+03',
        }, {
            fmt = '%Y-%OT%h:%m:%.3s%Z',
            buf = '2024-213T17:30:02.132+03',
        }, {
            fmt = '%Y-%OT%h:%m:%s,%u%Z',
            buf = '2024-213T17:30:02,132209+03',
        }, {
            fmt = '%Y-%OT%h:%m:%s.%u%Z',
            buf = '2024-213T17:30:02.132209+03',
        }, {
            fmt = '%Y-%OT%h%Z:%z',
            buf = '2024-213T17+03:00',
        }, {
            fmt = '%Y-%OT%,1h%Z:%z',
            buf = '2024-213T17,5+03:00',
        }, {
            fmt = '%Y-%OT%.1h%Z:%z',
            buf = '2024-213T17.5+03:00',
        }, {
            fmt = '%Y-%OT%h:%m%Z:%z',
            buf = '2024-213T17:30+03:00',
        }, {
            fmt = '%Y-%OT%h:%,1m%Z:%z',
            buf = '2024-213T17:30,0+03:00',
        }, {
            fmt = '%Y-%OT%h:%.1m%Z:%z',
            buf = '2024-213T17:30.0+03:00',
        }, {
            fmt = '%Y-%OT%h:%m:%s%Z:%z',
            buf = '2024-213T17:30:02+03:00',
        }, {
            fmt = '%Y-%OT%h:%m:%.1s%Z:%z',
            buf = '2024-213T17:30:02.1+03:00',
        }, {
            fmt = '%Y-%OT%h:%m:%.2s%Z:%z',
            buf = '2024-213T17:30:02.13+03:00',
        }, {
            fmt = '%Y-%OT%h:%m:%,3s%Z:%z',
            buf = '2024-213T17:30:02,132+03:00',
        }, {
            fmt = '%Y-%OT%h:%m:%.3s%Z:%z',
            buf = '2024-213T17:30:02.132+03:00',
        }, {
            fmt = '%Y-%OT%h:%m:%s,%u%Z:%z',
            buf = '2024-213T17:30:02,132209+03:00',
        }, {
            fmt = '%Y-%OT%h:%m:%s.%u%Z:%z',
            buf = '2024-213T17:30:02.132209+03:00',
        }, {
            fmt = '%Y%M%DT%h',
            buf = '20240731T17',
        }, {
            fmt = '%Y%M%DT%,1h',
            buf = '20240731T17,5',
        }, {
            fmt = '%Y%M%DT%.1h',
            buf = '20240731T17.5',
        }, {
            fmt = '%Y%M%DT%h%m',
            buf = '20240731T1730',
        }, {
            fmt = '%Y%M%DT%h%,1m',
            buf = '20240731T1730,0',
        }, {
            fmt = '%Y%M%DT%h%.1m',
            buf = '20240731T1730.0',
        }, {
            fmt = '%Y%M%DT%h%m%s',
            buf = '20240731T173002',
        }, {
            fmt = '%Y%M%DT%h%m%.1s',
            buf = '20240731T173002.1',
        }, {
            fmt = '%Y%M%DT%h%m%.2s',
            buf = '20240731T173002.13',
        }, {
            fmt = '%Y%M%DT%h%m%,3s',
            buf = '20240731T173002,132',
        }, {
            fmt = '%Y%M%DT%h%m%.3s',
            buf = '20240731T173002.132',
        }, {
            fmt = '%Y%M%DT%h%m%s,%u',
            buf = '20240731T173002,132209',
        }, {
            fmt = '%Y%M%DT%h%m%s.%u',
            buf = '20240731T173002.132209',
        }, {
            fmt = '%Y%M%DT%hZ',
            buf = '20240731T14Z',
        }, {
            fmt = '%Y%M%DT%,1hZ',
            buf = '20240731T14,5Z',
        }, {
            fmt = '%Y%M%DT%.1hZ',
            buf = '20240731T14.5Z',
        }, {
            fmt = '%Y%M%DT%h%mZ',
            buf = '20240731T1430Z',
        }, {
            fmt = '%Y%M%DT%h%,1mZ',
            buf = '20240731T1430,0Z',
        }, {
            fmt = '%Y%M%DT%h%.1mZ',
            buf = '20240731T1430.0Z',
        }, {
            fmt = '%Y%M%DT%h%m%sZ',
            buf = '20240731T143002Z',
        }, {
            fmt = '%Y%M%DT%h%m%.1sZ',
            buf = '20240731T143002.1Z',
        }, {
            fmt = '%Y%M%DT%h%m%.2sZ',
            buf = '20240731T143002.13Z',
        }, {
            fmt = '%Y%M%DT%h%m%,3sZ',
            buf = '20240731T143002,132Z',
        }, {
            fmt = '%Y%M%DT%h%m%.3sZ',
            buf = '20240731T143002.132Z',
        }, {
            fmt = '%Y%M%DT%h%m%s,%uZ',
            buf = '20240731T143002,132209Z',
        }, {
            fmt = '%Y%M%DT%h%m%s.%uZ',
            buf = '20240731T143002.132209Z',
        }, {
            fmt = '%Y%M%DT%h%Z',
            buf = '20240731T17+03',
        }, {
            fmt = '%Y%M%DT%,1h%Z',
            buf = '20240731T17,5+03',
        }, {
            fmt = '%Y%M%DT%.1h%Z',
            buf = '20240731T17.5+03',
        }, {
            fmt = '%Y%M%DT%h%m%Z',
            buf = '20240731T1730+03',
        }, {
            fmt = '%Y%M%DT%h%,1m%Z',
            buf = '20240731T1730,0+03',
        }, {
            fmt = '%Y%M%DT%h%.1m%Z',
            buf = '20240731T1730.0+03',
        }, {
            fmt = '%Y%M%DT%h%m%s%Z',
            buf = '20240731T173002+03',
        }, {
            fmt = '%Y%M%DT%h%m%.1s%Z',
            buf = '20240731T173002.1+03',
        }, {
            fmt = '%Y%M%DT%h%m%.2s%Z',
            buf = '20240731T173002.13+03',
        }, {
            fmt = '%Y%M%DT%h%m%,3s%Z',
            buf = '20240731T173002,132+03',
        }, {
            fmt = '%Y%M%DT%h%m%.3s%Z',
            buf = '20240731T173002.132+03',
        }, {
            fmt = '%Y%M%DT%h%m%s,%u%Z',
            buf = '20240731T173002,132209+03',
        }, {
            fmt = '%Y%M%DT%h%m%s.%u%Z',
            buf = '20240731T173002.132209+03',
        }, {
            fmt = '%Y%M%DT%h%Z%z',
            buf = '20240731T17+0300',
        }, {
            fmt = '%Y%M%DT%,1h%Z%z',
            buf = '20240731T17,5+0300',
        }, {
            fmt = '%Y%M%DT%.1h%Z%z',
            buf = '20240731T17.5+0300',
        }, {
            fmt = '%Y%M%DT%h%m%Z%z',
            buf = '20240731T1730+0300',
        }, {
            fmt = '%Y%M%DT%h%,1m%Z%z',
            buf = '20240731T1730,0+0300',
        }, {
            fmt = '%Y%M%DT%h%.1m%Z%z',
            buf = '20240731T1730.0+0300',
        }, {
            fmt = '%Y%M%DT%h%m%s%Z%z',
            buf = '20240731T173002+0300',
        }, {
            fmt = '%Y%M%DT%h%m%.1s%Z%z',
            buf = '20240731T173002.1+0300',
        }, {
            fmt = '%Y%M%DT%h%m%.2s%Z%z',
            buf = '20240731T173002.13+0300',
        }, {
            fmt = '%Y%M%DT%h%m%,3s%Z%z',
            buf = '20240731T173002,132+0300',
        }, {
            fmt = '%Y%M%DT%h%m%.3s%Z%z',
            buf = '20240731T173002.132+0300',
        }, {
            fmt = '%Y%M%DT%h%m%s,%u%Z%z',
            buf = '20240731T173002,132209+0300',
        }, {
            fmt = '%Y%M%DT%h%m%s.%u%Z%z',
            buf = '20240731T173002.132209+0300',
        }, {
            fmt = '%VW%W%wT%h',
            buf = '2024W313T17',
        }, {
            fmt = '%VW%W%wT%,1h',
            buf = '2024W313T17,5',
        }, {
            fmt = '%VW%W%wT%.1h',
            buf = '2024W313T17.5',
        }, {
            fmt = '%VW%W%wT%h%m',
            buf = '2024W313T1730',
        }, {
            fmt = '%VW%W%wT%h%,1m',
            buf = '2024W313T1730,0',
        }, {
            fmt = '%VW%W%wT%h%.1m',
            buf = '2024W313T1730.0',
        }, {
            fmt = '%VW%W%wT%h%m%s',
            buf = '2024W313T173002',
        }, {
            fmt = '%VW%W%wT%h%m%.1s',
            buf = '2024W313T173002.1',
        }, {
            fmt = '%VW%W%wT%h%m%.2s',
            buf = '2024W313T173002.13',
        }, {
            fmt = '%VW%W%wT%h%m%,3s',
            buf = '2024W313T173002,132',
        }, {
            fmt = '%VW%W%wT%h%m%.3s',
            buf = '2024W313T173002.132',
        }, {
            fmt = '%VW%W%wT%h%m%s,%u',
            buf = '2024W313T173002,132209',
        }, {
            fmt = '%VW%W%wT%h%m%s.%u',
            buf = '2024W313T173002.132209',
        }, {
            fmt = '%VW%W%wT%hZ',
            buf = '2024W313T14Z',
        }, {
            fmt = '%VW%W%wT%,1hZ',
            buf = '2024W313T14,5Z',
        }, {
            fmt = '%VW%W%wT%.1hZ',
            buf = '2024W313T14.5Z',
        }, {
            fmt = '%VW%W%wT%h%mZ',
            buf = '2024W313T1430Z',
        }, {
            fmt = '%VW%W%wT%h%,1mZ',
            buf = '2024W313T1430,0Z',
        }, {
            fmt = '%VW%W%wT%h%.1mZ',
            buf = '2024W313T1430.0Z',
        }, {
            fmt = '%VW%W%wT%h%m%sZ',
            buf = '2024W313T143002Z',
        }, {
            fmt = '%VW%W%wT%h%m%.1sZ',
            buf = '2024W313T143002.1Z',
        }, {
            fmt = '%VW%W%wT%h%m%.2sZ',
            buf = '2024W313T143002.13Z',
        }, {
            fmt = '%VW%W%wT%h%m%,3sZ',
            buf = '2024W313T143002,132Z',
        }, {
            fmt = '%VW%W%wT%h%m%.3sZ',
            buf = '2024W313T143002.132Z',
        }, {
            fmt = '%VW%W%wT%h%m%s,%uZ',
            buf = '2024W313T143002,132209Z',
        }, {
            fmt = '%VW%W%wT%h%m%s.%uZ',
            buf = '2024W313T143002.132209Z',
        }, {
            fmt = '%VW%W%wT%h%Z',
            buf = '2024W313T17+03',
        }, {
            fmt = '%VW%W%wT%,1h%Z',
            buf = '2024W313T17,5+03',
        }, {
            fmt = '%VW%W%wT%.1h%Z',
            buf = '2024W313T17.5+03',
        }, {
            fmt = '%VW%W%wT%h%m%Z',
            buf = '2024W313T1730+03',
        }, {
            fmt = '%VW%W%wT%h%,1m%Z',
            buf = '2024W313T1730,0+03',
        }, {
            fmt = '%VW%W%wT%h%.1m%Z',
            buf = '2024W313T1730.0+03',
        }, {
            fmt = '%VW%W%wT%h%m%s%Z',
            buf = '2024W313T173002+03',
        }, {
            fmt = '%VW%W%wT%h%m%.1s%Z',
            buf = '2024W313T173002.1+03',
        }, {
            fmt = '%VW%W%wT%h%m%.2s%Z',
            buf = '2024W313T173002.13+03',
        }, {
            fmt = '%VW%W%wT%h%m%,3s%Z',
            buf = '2024W313T173002,132+03',
        }, {
            fmt = '%VW%W%wT%h%m%.3s%Z',
            buf = '2024W313T173002.132+03',
        }, {
            fmt = '%VW%W%wT%h%m%s,%u%Z',
            buf = '2024W313T173002,132209+03',
        }, {
            fmt = '%VW%W%wT%h%m%s.%u%Z',
            buf = '2024W313T173002.132209+03',
        }, {
            fmt = '%VW%W%wT%h%Z%z',
            buf = '2024W313T17+0300',
        }, {
            fmt = '%VW%W%wT%,1h%Z%z',
            buf = '2024W313T17,5+0300',
        }, {
            fmt = '%VW%W%wT%.1h%Z%z',
            buf = '2024W313T17.5+0300',
        }, {
            fmt = '%VW%W%wT%h%m%Z%z',
            buf = '2024W313T1730+0300',
        }, {
            fmt = '%VW%W%wT%h%,1m%Z%z',
            buf = '2024W313T1730,0+0300',
        }, {
            fmt = '%VW%W%wT%h%.1m%Z%z',
            buf = '2024W313T1730.0+0300',
        }, {
            fmt = '%VW%W%wT%h%m%s%Z%z',
            buf = '2024W313T173002+0300',
        }, {
            fmt = '%VW%W%wT%h%m%.1s%Z%z',
            buf = '2024W313T173002.1+0300',
        }, {
            fmt = '%VW%W%wT%h%m%.2s%Z%z',
            buf = '2024W313T173002.13+0300',
        }, {
            fmt = '%VW%W%wT%h%m%,3s%Z%z',
            buf = '2024W313T173002,132+0300',
        }, {
            fmt = '%VW%W%wT%h%m%.3s%Z%z',
            buf = '2024W313T173002.132+0300',
        }, {
            fmt = '%VW%W%wT%h%m%s,%u%Z%z',
            buf = '2024W313T173002,132209+0300',
        }, {
            fmt = '%VW%W%wT%h%m%s.%u%Z%z',
            buf = '2024W313T173002.132209+0300',
        }, {
            fmt = '%Y%OT%h',
            buf = '2024213T17',
        }, {
            fmt = '%Y%OT%,1h',
            buf = '2024213T17,5',
        }, {
            fmt = '%Y%OT%.1h',
            buf = '2024213T17.5',
        }, {
            fmt = '%Y%OT%h%m',
            buf = '2024213T1730',
        }, {
            fmt = '%Y%OT%h%,1m',
            buf = '2024213T1730,0',
        }, {
            fmt = '%Y%OT%h%.1m',
            buf = '2024213T1730.0',
        }, {
            fmt = '%Y%OT%h%m%s',
            buf = '2024213T173002',
        }, {
            fmt = '%Y%OT%h%m%.1s',
            buf = '2024213T173002.1',
        }, {
            fmt = '%Y%OT%h%m%.2s',
            buf = '2024213T173002.13',
        }, {
            fmt = '%Y%OT%h%m%,3s',
            buf = '2024213T173002,132',
        }, {
            fmt = '%Y%OT%h%m%.3s',
            buf = '2024213T173002.132',
        }, {
            fmt = '%Y%OT%h%m%s,%u',
            buf = '2024213T173002,132209',
        }, {
            fmt = '%Y%OT%h%m%s.%u',
            buf = '2024213T173002.132209',
        }, {
            fmt = '%Y%OT%hZ',
            buf = '2024213T14Z',
        }, {
            fmt = '%Y%OT%,1hZ',
            buf = '2024213T14,5Z',
        }, {
            fmt = '%Y%OT%.1hZ',
            buf = '2024213T14.5Z',
        }, {
            fmt = '%Y%OT%h%mZ',
            buf = '2024213T1430Z',
        }, {
            fmt = '%Y%OT%h%,1mZ',
            buf = '2024213T1430,0Z',
        }, {
            fmt = '%Y%OT%h%.1mZ',
            buf = '2024213T1430.0Z',
        }, {
            fmt = '%Y%OT%h%m%sZ',
            buf = '2024213T143002Z',
        }, {
            fmt = '%Y%OT%h%m%.1sZ',
            buf = '2024213T143002.1Z',
        }, {
            fmt = '%Y%OT%h%m%.2sZ',
            buf = '2024213T143002.13Z',
        }, {
            fmt = '%Y%OT%h%m%,3sZ',
            buf = '2024213T143002,132Z',
        }, {
            fmt = '%Y%OT%h%m%.3sZ',
            buf = '2024213T143002.132Z',
        }, {
            fmt = '%Y%OT%h%m%s,%uZ',
            buf = '2024213T143002,132209Z',
        }, {
            fmt = '%Y%OT%h%m%s.%uZ',
            buf = '2024213T143002.132209Z',
        }, {
            fmt = '%Y%OT%h%Z',
            buf = '2024213T17+03',
        }, {
            fmt = '%Y%OT%,1h%Z',
            buf = '2024213T17,5+03',
        }, {
            fmt = '%Y%OT%.1h%Z',
            buf = '2024213T17.5+03',
        }, {
            fmt = '%Y%OT%h%m%Z',
            buf = '2024213T1730+03',
        }, {
            fmt = '%Y%OT%h%,1m%Z',
            buf = '2024213T1730,0+03',
        }, {
            fmt = '%Y%OT%h%.1m%Z',
            buf = '2024213T1730.0+03',
        }, {
            fmt = '%Y%OT%h%m%s%Z',
            buf = '2024213T173002+03',
        }, {
            fmt = '%Y%OT%h%m%.1s%Z',
            buf = '2024213T173002.1+03',
        }, {
            fmt = '%Y%OT%h%m%.2s%Z',
            buf = '2024213T173002.13+03',
        }, {
            fmt = '%Y%OT%h%m%,3s%Z',
            buf = '2024213T173002,132+03',
        }, {
            fmt = '%Y%OT%h%m%.3s%Z',
            buf = '2024213T173002.132+03',
        }, {
            fmt = '%Y%OT%h%m%s,%u%Z',
            buf = '2024213T173002,132209+03',
        }, {
            fmt = '%Y%OT%h%m%s.%u%Z',
            buf = '2024213T173002.132209+03',
        }, {
            fmt = '%Y%OT%h%Z%z',
            buf = '2024213T17+0300',
        }, {
            fmt = '%Y%OT%,1h%Z%z',
            buf = '2024213T17,5+0300',
        }, {
            fmt = '%Y%OT%.1h%Z%z',
            buf = '2024213T17.5+0300',
        }, {
            fmt = '%Y%OT%h%m%Z%z',
            buf = '2024213T1730+0300',
        }, {
            fmt = '%Y%OT%h%,1m%Z%z',
            buf = '2024213T1730,0+0300',
        }, {
            fmt = '%Y%OT%h%.1m%Z%z',
            buf = '2024213T1730.0+0300',
        }, {
            fmt = '%Y%OT%h%m%s%Z%z',
            buf = '2024213T173002+0300',
        }, {
            fmt = '%Y%OT%h%m%.1s%Z%z',
            buf = '2024213T173002.1+0300',
        }, {
            fmt = '%Y%OT%h%m%.2s%Z%z',
            buf = '2024213T173002.13+0300',
        }, {
            fmt = '%Y%OT%h%m%,3s%Z%z',
            buf = '2024213T173002,132+0300',
        }, {
            fmt = '%Y%OT%h%m%.3s%Z%z',
            buf = '2024213T173002.132+0300',
        }, {
            fmt = '%Y%OT%h%m%s,%u%Z%z',
            buf = '2024213T173002,132209+0300',
        }, {
            fmt = '%Y%OT%h%m%s.%u%Z%z',
            buf = '2024213T173002.132209+0300',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%s+08',
            buf = '2024-07-31T22:30:02+08',
        }, {
            fmt = '%Y-%M-%DT%h-12',
            buf = '2024-07-31T02-12',
        }, {
            fmt = '%Y-%M-%DT%h-12:00',
            buf = '2024-07-31T02-12:00',
        }, {
            fmt = '%Y-%M-%DT%h:%m-12',
            buf = '2024-07-31T02:30-12',
        }, {
            fmt = '%Y-%M-%DT%h:%m-12:00',
            buf = '2024-07-31T02:30-12:00',
        },
        -- Ranges.
        {
            fmt = '%Y-%M-%DT%h/P1DT1H',
            buf = '2024-07-31T17/P1DT1H',
        }, {
            fmt = '%Y-%M-%DT%h:%m/P1DT1H',
            buf = '2024-07-31T17:42/P1DT1H',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%s/P1DT1H',
            buf = '2024-07-31T17:42:56/P1DT1H',
        }, {
            fmt = '%Y-%M-%DT%h:%m:%.3s/P1DT1H',
            buf = '2024-07-31T17:42:56.132/P1DT1H',
        }, {
            fmt = '%V-W%W-%wT%h/P1DT1H',
            buf = '2024-W31-3T17/P1DT1H',
        }, {
            fmt = '%V-W%W-%wT%h:%m/P1DT1H',
            buf = '2024-W31-3T17:42/P1DT1H',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%s/P1DT1H',
            buf = '2024-W31-3T17:42:56/P1DT1H',
        }, {
            fmt = '%V-W%W-%wT%h:%m:%.3s/P1DT1H',
            buf = '2024-W31-3T17:42:56.132/P1DT1H',
        }, {
            fmt = '%Y-%OT%h/P1DT1H',
            buf = '2024-213T17/P1DT1H',
        }, {
            fmt = '%Y-%OT%h:%m/P1DT1H',
            buf = '2024-213T17:42/P1DT1H',
        }, {
            fmt = '%Y-%OT%h:%m:%s/P1DT1H',
            buf = '2024-213T17:42:56/P1DT1H',
        }, {
            fmt = '%Y-%OT%h:%m:%.3s/P1DT1H',
            buf = '2024-213T17:42:56.132/P1DT1H',
        },
    },
}

local UNSUPPORTED_DATETIME_FORMATS = {
    ['RFC3339 AND ISO8601'] = {
        -- Times.
        {
            fmt = '%h:%m:%s%Z:%z',
            buf = '15:55:43+03:00',
        }, {
            fmt = '%h:%m:%.1s%Z:%z',
            buf = '15:55:43.1+03:00',
        }, {
            fmt = '%h:%m:%.2s%Z:%z',
            buf = '15:55:43.13+03:00',
        }, {
            fmt = '%h:%m:%.3s%Z:%z',
            buf = '15:55:43.132+03:00',
        }, {
            fmt = '%h:%m:%s.%u%Z:%z',
            buf = '15:55:43.132209+03:00',
        }, {
            fmt = '%h:%m:%sZ',
            buf = '12:55:43Z',
        }, {
            fmt = '%h:%m:%.1sZ',
            buf = '12:55:43.1Z',
        }, {
            fmt = '%h:%m:%.2sZ',
            buf = '12:55:43.13Z',
        }, {
            fmt = '%h:%m:%.3sZ',
            buf = '12:55:43.132Z',
        }, {
            fmt = '%h:%m:%s.%uZ',
            buf = '12:55:43.132209Z',
        }, {
            fmt = '%h:%m:%s+00:00',
            buf = '12:55:43+00:00',
        }, {
            fmt = '%h:%m:%.1s+00:00',
            buf = '12:55:43.1+00:00',
        }, {
            fmt = '%h:%m:%.3s+00:00',
            buf = '12:55:43.132+00:00',
        }, {
            fmt = '%h:%m:%s.%u+00:00',
            buf = '12:55:43.132209+00:00',
        },
    },

    ['RFC3339 ONLY'] = {
        -- Times.
        {
            fmt = '%h:%m:%s-00:00',
            buf = '12:55:43-00:00',
        }, {
            fmt = '%h:%m:%.1s-00:00',
            buf = '12:55:43.1-00:00',
        }, {
            fmt = '%h:%m:%.3s-00:00',
            buf = '12:55:43.132-00:00',
        }, {
            fmt = '%h:%m:%s.%u-00:00',
            buf = '12:55:43.132209-00:00',
        },
        -- Dates-Times.
        {
            fmt = '%Y-%M-%D_%h:%m:%sZ',
            buf = '2024-07-31_14:30:02Z',
        }, {
            fmt = '%Y-%M-%D_%h:%m:%sz',
            buf = '2024-07-31_14:30:02z',
        }, {
            fmt = '%Y-%M-%D_%h:%m:%.3sZ',
            buf = '2024-07-31_14:30:02.132Z',
        }, {
            fmt = '%Y-%M-%D_%h:%m:%s.%uZ',
            buf = '2024-07-31_14:30:02.132209Z',
        }, {
            fmt = '%Y-%M-%D_%h:%m:%.3sz',
            buf = '2024-07-31_14:30:02.132z',
        }, {
            fmt = '%Y-%M-%D_%h:%m:%s.%uz',
            buf = '2024-07-31_14:30:02.132209z',
        },
    },

    ['ISO8601 ONLY'] = {
        -- Dates.
        {
            fmt = '%C',
            buf = '20',
        }, {
            fmt = '%X',
            buf = '202',
        }, {
            fmt = '%Y',
            buf = '2024',
        }, {
            fmt = '%Y-%M',
            buf = '2024-07',
        }, {
            fmt = '%V-W%W',
            buf = '2024-W31',
        }, {
            fmt = '%VW%W',
            buf = '2024W31',
        },
        -- Times.
        {
            fmt = '%h',
            buf = '15',
        }, {
            fmt = '%,1h',
            buf = '15,9',
        }, {
            fmt = '%.1h',
            buf = '15.9',
        }, {
            fmt = '%h:%m',
            buf = '15:55',
        }, {
            fmt = '%h:%,1m',
            buf = '15:55,7',
        }, {
            fmt = '%h:%.1m',
            buf = '15:55.7',
        }, {
            fmt = '%h:%m:%s',
            buf = '15:55:43',
        }, {
            fmt = '%h:%m:%.1s',
            buf = '15:55:43.1',
        }, {
            fmt = '%h:%m:%.2s',
            buf = '15:55:43.13',
        }, {
            fmt = '%h:%m:%,3s',
            buf = '15:55:43,132',
        }, {
            fmt = '%h:%m:%.3s',
            buf = '15:55:43.132',
        }, {
            fmt = '%h:%m:%s,%u',
            buf = '15:55:43,132209',
        }, {
            fmt = '%h:%m:%s.%u',
            buf = '15:55:43.132209',
        }, {
            fmt = '%hZ',
            buf = '12Z',
        }, {
            fmt = '%,1hZ',
            buf = '12,9Z',
        }, {
            fmt = '%.1hZ',
            buf = '12.9Z',
        }, {
            fmt = '%h:%mZ',
            buf = '12:55Z',
        }, {
            fmt = '%h:%,1mZ',
            buf = '12:55,7Z',
        }, {
            fmt = '%h:%.1mZ',
            buf = '12:55.7Z',
        }, {
            fmt = '%h:%m:%,3sZ',
            buf = '12:55:43,132Z',
        }, {
            fmt = '%h:%m:%s,%uZ',
            buf = '12:55:43,132209Z',
        }, {
            fmt = '%h%Z',
            buf = '15+03',
        }, {
            fmt = '%,1h%Z',
            buf = '15,9+03',
        }, {
            fmt = '%.1h%Z',
            buf = '15.9+03',
        }, {
            fmt = '%h:%m%Z',
            buf = '15:55+03',
        }, {
            fmt = '%h:%,1m%Z',
            buf = '15:55,7+03',
        }, {
            fmt = '%h:%.1m%Z',
            buf = '15:55.7+03',
        }, {
            fmt = '%h:%m:%s%Z',
            buf = '15:55:43+03',
        }, {
            fmt = '%h:%m:%.1s%Z',
            buf = '15:55:43.1+03',
        }, {
            fmt = '%h:%m:%.2s%Z',
            buf = '15:55:43.13+03',
        }, {
            fmt = '%h:%m:%,3s%Z',
            buf = '15:55:43,132+03',
        }, {
            fmt = '%h:%m:%.3s%Z',
            buf = '15:55:43.132+03',
        }, {
            fmt = '%h:%m:%s,%u%Z',
            buf = '15:55:43,132209+03',
        }, {
            fmt = '%h:%m:%s.%u%Z',
            buf = '15:55:43.132209+03',
        }, {
            fmt = '%h%Z:%z',
            buf = '15+03:00',
        }, {
            fmt = '%,1h%Z:%z',
            buf = '15,9+03:00',
        }, {
            fmt = '%.1h%Z:%z',
            buf = '15.9+03:00',
        }, {
            fmt = '%h:%m%Z:%z',
            buf = '15:55+03:00',
        }, {
            fmt = '%h:%,1m%Z:%z',
            buf = '15:55,7+03:00',
        }, {
            fmt = '%h:%.1m%Z:%z',
            buf = '15:55.7+03:00',
        }, {
            fmt = '%h:%m:%,3s%Z:%z',
            buf = '15:55:43,132+03:00',
        }, {
            fmt = '%h:%m:%s,%u%Z:%z',
            buf = '15:55:43,132209+03:00',
        }, {
            fmt = 'T%h',
            buf = 'T15',
        }, {
            fmt = 'T%,1h',
            buf = 'T15,9',
        }, {
            fmt = 'T%.1h',
            buf = 'T15.9',
        }, {
            fmt = 'T%h:%m',
            buf = 'T15:55',
        }, {
            fmt = 'T%h:%,1m',
            buf = 'T15:55,7',
        }, {
            fmt = 'T%h:%.1m',
            buf = 'T15:55.7',
        }, {
            fmt = 'T%h:%m:%s',
            buf = 'T15:55:43',
        }, {
            fmt = 'T%h:%m:%.1s',
            buf = 'T15:55:43.1',
        }, {
            fmt = 'T%h:%m:%.2s',
            buf = 'T15:55:43.13',
        }, {
            fmt = 'T%h:%m:%,3s',
            buf = 'T15:55:43,132',
        }, {
            fmt = 'T%h:%m:%.3s',
            buf = 'T15:55:43.132',
        }, {
            fmt = 'T%h:%m:%s,%u',
            buf = 'T15:55:43,132209',
        }, {
            fmt = 'T%h:%m:%s.%u',
            buf = 'T15:55:43.132209',
        }, {
            fmt = 'T%hZ',
            buf = 'T12Z',
        }, {
            fmt = 'T%,1hZ',
            buf = 'T12,9Z',
        }, {
            fmt = 'T%.1hZ',
            buf = 'T12.9Z',
        }, {
            fmt = 'T%h:%mZ',
            buf = 'T12:55Z',
        }, {
            fmt = 'T%h:%,1mZ',
            buf = 'T12:55,7Z',
        }, {
            fmt = 'T%h:%.1mZ',
            buf = 'T12:55.7Z',
        }, {
            fmt = 'T%h:%m:%sZ',
            buf = 'T12:55:43Z',
        }, {
            fmt = 'T%h:%m:%.1sZ',
            buf = 'T12:55:43.1Z',
        }, {
            fmt = 'T%h:%m:%.2sZ',
            buf = 'T12:55:43.13Z',
        }, {
            fmt = 'T%h:%m:%,3sZ',
            buf = 'T12:55:43,132Z',
        }, {
            fmt = 'T%h:%m:%.3sZ',
            buf = 'T12:55:43.132Z',
        }, {
            fmt = 'T%h:%m:%s,%uZ',
            buf = 'T12:55:43,132209Z',
        }, {
            fmt = 'T%h:%m:%s.%uZ',
            buf = 'T12:55:43.132209Z',
        }, {
            fmt = 'T%h%Z',
            buf = 'T15+03',
        }, {
            fmt = 'T%,1h%Z',
            buf = 'T15,9+03',
        }, {
            fmt = 'T%.1h%Z',
            buf = 'T15.9+03',
        }, {
            fmt = 'T%h:%m%Z',
            buf = 'T15:55+03',
        }, {
            fmt = 'T%h:%,1m%Z',
            buf = 'T15:55,7+03',
        }, {
            fmt = 'T%h:%.1m%Z',
            buf = 'T15:55.7+03',
        }, {
            fmt = 'T%h:%m:%s%Z',
            buf = 'T15:55:43+03',
        }, {
            fmt = 'T%h:%m:%.1s%Z',
            buf = 'T15:55:43.1+03',
        }, {
            fmt = 'T%h:%m:%.2s%Z',
            buf = 'T15:55:43.13+03',
        }, {
            fmt = 'T%h:%m:%,3s%Z',
            buf = 'T15:55:43,132+03',
        }, {
            fmt = 'T%h:%m:%.3s%Z',
            buf = 'T15:55:43.132+03',
        }, {
            fmt = 'T%h:%m:%s,%u%Z',
            buf = 'T15:55:43,132209+03',
        }, {
            fmt = 'T%h:%m:%s.%u%Z',
            buf = 'T15:55:43.132209+03',
        }, {
            fmt = 'T%h%Z:%z',
            buf = 'T15+03:00',
        }, {
            fmt = 'T%,1h%Z:%z',
            buf = 'T15,9+03:00',
        }, {
            fmt = 'T%.1h%Z:%z',
            buf = 'T15.9+03:00',
        }, {
            fmt = 'T%h:%m%Z:%z',
            buf = 'T15:55+03:00',
        }, {
            fmt = 'T%h:%,1m%Z:%z',
            buf = 'T15:55,7+03:00',
        }, {
            fmt = 'T%h:%.1m%Z:%z',
            buf = 'T15:55.7+03:00',
        }, {
            fmt = 'T%h:%m:%s%Z:%z',
            buf = 'T15:55:43+03:00',
        }, {
            fmt = 'T%h:%m:%.1s%Z:%z',
            buf = 'T15:55:43.1+03:00',
        }, {
            fmt = 'T%h:%m:%.2s%Z:%z',
            buf = 'T15:55:43.13+03:00',
        }, {
            fmt = 'T%h:%m:%,3s%Z:%z',
            buf = 'T15:55:43,132+03:00',
        }, {
            fmt = 'T%h:%m:%.3s%Z:%z',
            buf = 'T15:55:43.132+03:00',
        }, {
            fmt = 'T%h:%m:%s,%u%Z:%z',
            buf = 'T15:55:43,132209+03:00',
        }, {
            fmt = 'T%h:%m:%s.%u%Z:%z',
            buf = 'T15:55:43.132209+03:00',
        }, {
            fmt = '%h%m',
            buf = '1555',
        }, {
            fmt = '%h%,1m',
            buf = '1555,7',
        }, {
            fmt = '%h%.1m',
            buf = '1555.7',
        }, {
            fmt = '%h%m%s',
            buf = '155543',
        }, {
            fmt = '%h%m%.1s',
            buf = '155543.1',
        }, {
            fmt = '%h%m%.2s',
            buf = '155543.13',
        }, {
            fmt = '%h%m%,3s',
            buf = '155543,132',
        }, {
            fmt = '%h%m%.3s',
            buf = '155543.132',
        }, {
            fmt = '%h%m%s,%u',
            buf = '155543,132209',
        }, {
            fmt = '%h%m%s.%u',
            buf = '155543.132209',
        }, {
            fmt = '%h%mZ',
            buf = '1255Z',
        }, {
            fmt = '%h%,1mZ',
            buf = '1255,7Z',
        }, {
            fmt = '%h%.1mZ',
            buf = '1255.7Z',
        }, {
            fmt = '%h%m%sZ',
            buf = '125543Z',
        }, {
            fmt = '%h%m%.1sZ',
            buf = '125543.1Z',
        }, {
            fmt = '%h%m%.2sZ',
            buf = '125543.13Z',
        }, {
            fmt = '%h%m%,3sZ',
            buf = '125543,132Z',
        }, {
            fmt = '%h%m%.3sZ',
            buf = '125543.132Z',
        }, {
            fmt = '%h%m%s,%uZ',
            buf = '125543,132209Z',
        }, {
            fmt = '%h%m%s.%uZ',
            buf = '125543.132209Z',
        }, {
            fmt = '%h%m%Z',
            buf = '1555+03',
        }, {
            fmt = '%h%,1m%Z',
            buf = '1555,7+03',
        }, {
            fmt = '%h%.1m%Z',
            buf = '1555.7+03',
        }, {
            fmt = '%h%m%s%Z',
            buf = '155543+03',
        }, {
            fmt = '%h%m%.1s%Z',
            buf = '155543.1+03',
        }, {
            fmt = '%h%m%.2s%Z',
            buf = '155543.13+03',
        }, {
            fmt = '%h%m%,3s%Z',
            buf = '155543,132+03',
        }, {
            fmt = '%h%m%.3s%Z',
            buf = '155543.132+03',
        }, {
            fmt = '%h%m%s,%u%Z',
            buf = '155543,132209+03',
        }, {
            fmt = '%h%m%s.%u%Z',
            buf = '155543.132209+03',
        }, {
            fmt = '%h%Z%z',
            buf = '15+0300',
        }, {
            fmt = '%,1h%Z%z',
            buf = '15,9+0300',
        }, {
            fmt = '%.1h%Z%z',
            buf = '15.9+0300',
        }, {
            fmt = '%h%m%Z%z',
            buf = '1555+0300',
        }, {
            fmt = '%h%,1m%Z%z',
            buf = '1555,7+0300',
        }, {
            fmt = '%h%.1m%Z%z',
            buf = '1555.7+0300',
        }, {
            fmt = '%h%m%s%Z%z',
            buf = '155543+0300',
        }, {
            fmt = '%h%m%.1s%Z%z',
            buf = '155543.1+0300',
        }, {
            fmt = '%h%m%.2s%Z%z',
            buf = '155543.13+0300',
        }, {
            fmt = '%h%m%,3s%Z%z',
            buf = '155543,132+0300',
        }, {
            fmt = '%h%m%.3s%Z%z',
            buf = '155543.132+0300',
        }, {
            fmt = '%h%m%s,%u%Z%z',
            buf = '155543,132209+0300',
        }, {
            fmt = '%h%m%s.%u%Z%z',
            buf = '155543.132209+0300',
        }, {
            fmt = 'T%h%m',
            buf = 'T1555',
        }, {
            fmt = 'T%h%,1m',
            buf = 'T1555,7',
        }, {
            fmt = 'T%h%.1m',
            buf = 'T1555.7',
        }, {
            fmt = 'T%h%m%s',
            buf = 'T155543',
        }, {
            fmt = 'T%h%m%.1s',
            buf = 'T155543.1',
        }, {
            fmt = 'T%h%m%.2s',
            buf = 'T155543.13',
        }, {
            fmt = 'T%h%m%,3s',
            buf = 'T155543,132',
        }, {
            fmt = 'T%h%m%.3s',
            buf = 'T155543.132',
        }, {
            fmt = 'T%h%m%s,%u',
            buf = 'T155543,132209',
        }, {
            fmt = 'T%h%m%s.%u',
            buf = 'T155543.132209',
        }, {
            fmt = 'T%h%mZ',
            buf = 'T1255Z',
        }, {
            fmt = 'T%h%,1mZ',
            buf = 'T1255,7Z',
        }, {
            fmt = 'T%h%.1mZ',
            buf = 'T1255.7Z',
        }, {
            fmt = 'T%h%m%sZ',
            buf = 'T125543Z',
        }, {
            fmt = 'T%h%m%.1sZ',
            buf = 'T125543.1Z',
        }, {
            fmt = 'T%h%m%.2sZ',
            buf = 'T125543.13Z',
        }, {
            fmt = 'T%h%m%,3sZ',
            buf = 'T125543,132Z',
        }, {
            fmt = 'T%h%m%.3sZ',
            buf = 'T125543.132Z',
        }, {
            fmt = 'T%h%m%s,%uZ',
            buf = 'T125543,132209Z',
        }, {
            fmt = 'T%h%m%s.%uZ',
            buf = 'T125543.132209Z',
        }, {
            fmt = 'T%h%m%Z',
            buf = 'T1555+03',
        }, {
            fmt = 'T%h%,1m%Z',
            buf = 'T1555,7+03',
        }, {
            fmt = 'T%h%.1m%Z',
            buf = 'T1555.7+03',
        }, {
            fmt = 'T%h%m%s%Z',
            buf = 'T155543+03',
        }, {
            fmt = 'T%h%m%.1s%Z',
            buf = 'T155543.1+03',
        }, {
            fmt = 'T%h%m%.2s%Z',
            buf = 'T155543.13+03',
        }, {
            fmt = 'T%h%m%,3s%Z',
            buf = 'T155543,132+03',
        }, {
            fmt = 'T%h%m%.3s%Z',
            buf = 'T155543.132+03',
        }, {
            fmt = 'T%h%m%s,%u%Z',
            buf = 'T155543,132209+03',
        }, {
            fmt = 'T%h%m%s.%u%Z',
            buf = 'T155543.132209+03',
        }, {
            fmt = 'T%h%Z%z',
            buf = 'T15+0300',
        }, {
            fmt = 'T%,1h%Z%z',
            buf = 'T15,9+0300',
        }, {
            fmt = 'T%.1h%Z%z',
            buf = 'T15.9+0300',
        }, {
            fmt = 'T%h%m%Z%z',
            buf = 'T1555+0300',
        }, {
            fmt = 'T%h%,1m%Z%z',
            buf = 'T1555,7+0300',
        }, {
            fmt = 'T%h%.1m%Z%z',
            buf = 'T1555.7+0300',
        }, {
            fmt = 'T%h%m%s%Z%z',
            buf = 'T155543+0300',
        }, {
            fmt = 'T%h%m%.1s%Z%z',
            buf = 'T155543.1+0300',
        }, {
            fmt = 'T%h%m%.2s%Z%z',
            buf = 'T155543.13+0300',
        }, {
            fmt = 'T%h%m%,3s%Z%z',
            buf = 'T155543,132+0300',
        }, {
            fmt = 'T%h%m%.3s%Z%z',
            buf = 'T155543.132+0300',
        }, {
            fmt = 'T%h%m%s,%u%Z%z',
            buf = 'T155543,132209+0300',
        }, {
            fmt = 'T%h%m%s.%u%Z%z',
            buf = 'T155543.132209+0300',
        },
        -- Periods.
        {
            fmt = 'P1Y',
            buf = 'P1Y',
        }, {
            fmt = 'P1,5Y',
            buf = 'P1,5Y',
        }, {
            fmt = 'P1.5Y',
            buf = 'P1.5Y',
        }, {
            fmt = 'P1M',
            buf = 'P1M',
        }, {
            fmt = 'P1W',
            buf = 'P1W',
        }, {
            fmt = 'P1D',
            buf = 'P1D',
        }, {
            fmt = 'PT1H',
            buf = 'PT1H',
        }, {
            fmt = 'P1H',
            buf = 'P1H',
        }, {
            fmt = 'PT1M',
            buf = 'PT1M',
        }, {
            fmt = 'PT1S',
            buf = 'PT1S',
        }, {
            fmt = 'P1S',
            buf = 'P1S',
        }, {
            fmt = 'PT1,5S',
            buf = 'PT1,5S',
        }, {
            fmt = 'PT1.5S',
            buf = 'PT1.5S',
        }, {
            fmt = 'P1Y1M',
            buf = 'P1Y1M',
        }, {
            fmt = 'P1Y1D',
            buf = 'P1Y1D',
        }, {
            fmt = 'P1Y1M1D',
            buf = 'P1Y1M1D',
        }, {
            fmt = 'P1Y1M1DT1H1M1S',
            buf = 'P1Y1M1DT1H1M1S',
        }, {
            fmt = 'P1DT1H',
            buf = 'P1DT1H',
        }, {
            fmt = 'P1MT1M',
            buf = 'P1MT1M',
        }, {
            fmt = 'P1DT1M',
            buf = 'P1DT1M',
        }, {
            fmt = 'P1.5W',
            buf = 'P1.5W',
        }, {
            fmt = 'P1,5W',
            buf = 'P1,5W',
        }, {
            fmt = 'P1DT1.000S',
            buf = 'P1DT1.000S',
        }, {
            fmt = 'P1DT1.00000S',
            buf = 'P1DT1.00000S',
        }, {
            fmt = 'P1DT1H1M1.1S',
            buf = 'P1DT1H1M1.1S',
        }, {
            fmt = 'P1H1M1.1S',
            buf = 'P1H1M1.1S',
        },
        -- Ranges.
        {
            fmt = '%Y-%M-%D/P1Y',
            buf = '2024-07-31/P1Y',
        }, {
            fmt = '%Y-%M-%D/P1M',
            buf = '2024-07-31/P1M',
        }, {
            fmt = '%Y-%M-%D/P1D',
            buf = '2024-07-31/P1D',
        }, {
            fmt = '%V-W%W-%w/P1Y',
            buf = '2024-W31-3/P1Y',
        }, {
            fmt = '%V-W%W-%w/P1M',
            buf = '2024-W31-3/P1M',
        }, {
            fmt = '%V-W%W-%w/P1D',
            buf = '2024-W31-3/P1D',
        }, {
            fmt = '%Y-%O/P1Y',
            buf = '2024-213/P1Y',
        }, {
            fmt = '%Y-%O/P1M',
            buf = '2024-213/P1M',
        }, {
            fmt = '%Y-%O/P1D',
            buf = '2024-213/P1D',
        }, {
            fmt = '%Y-%M-%D/%Y-%M-%D',
            buf = '2024-07-31/2024-07-31',
        }, {
            fmt = '%Y-%M-%D/%V-W%W-%w',
            buf = '2024-07-31/2024-W31-3',
        }, {
            fmt = '%Y-%M-%D/%Y-%O',
            buf = '2024-07-31/2024-213',
        }, {
            fmt = '%V-W%W-%w/%Y-%M-%D',
            buf = '2024-W31-3/2024-07-31',
        }, {
            fmt = '%V-W%W-%w/%V-W%W-%w',
            buf = '2024-W31-3/2024-W31-3',
        }, {
            fmt = '%V-W%W-%w/%Y-%O',
            buf = '2024-W31-3/2024-213',
        }, {
            fmt = '%Y-%O/%Y-%M-%D',
            buf = '2024-213/2024-07-31',
        }, {
            fmt = '%Y-%O/%V-W%W-%w',
            buf = '2024-213/2024-W31-3',
        }, {
            fmt = '%Y-%O/%Y-%O',
            buf = '2024-213/2024-213',
        }, {
            fmt = 'P1Y/%Y-%M-%D',
            buf = 'P1Y/2024-07-31',
        }, {
            fmt = 'P1Y/%V-W%W-%w',
            buf = 'P1Y/2024-W31-3',
        }, {
            fmt = 'P1Y/%Y-%O',
            buf = 'P1Y/2024-213',
        }, {
            fmt = 'P1M/%Y-%M-%D',
            buf = 'P1M/2024-07-31',
        }, {
            fmt = 'P1M/%V-W%W-%w',
            buf = 'P1M/2024-W31-3',
        }, {
            fmt = 'P1M/%Y-%O',
            buf = 'P1M/2024-213',
        }, {
            fmt = 'P1D/%Y-%M-%D',
            buf = 'P1D/2024-07-31',
        }, {
            fmt = 'P1D/%V-W%W-%w',
            buf = 'P1D/2024-W31-3',
        }, {
            fmt = 'P1D/%Y-%O',
            buf = 'P1D/2024-213',
        }, {
            fmt = '%Y-%M-%DT%h:%mZ/P1DT1H',
            buf = '2024-07-31T17:42Z/P1DT1H',
        }, {
            fmt = '%V-W%W-%wT%h:%mZ/P1DT1H',
            buf = '2024-W31-3T17:42Z/P1DT1H',
        }, {
            fmt = '%Y-%OT%h:%mZ/P1DT1H',
            buf = '2024-213T17:42Z/P1DT1H',
        }, {
            fmt = 'P1DT1H/%Y-%M-%DT%h',
            buf = 'P1DT1H/2024-07-31T17',
        }, {
            fmt = 'P1DT1H/%Y-%M-%DT%h:%m',
            buf = 'P1DT1H/2024-07-31T17:42',
        }, {
            fmt = 'P1DT1H/%Y-%M-%DT%h:%m:%s',
            buf = 'P1DT1H/2024-07-31T17:42:56',
        }, {
            fmt = 'P1DT1H/%Y-%M-%DT%h:%m:%.3s',
            buf = 'P1DT1H/2024-07-31T17:42:56.132',
        }, {
            fmt = 'P1DT1H/%Y-%M-%DT%h:%mZ',
            buf = 'P1DT1H/2024-07-31T14:42Z',
        }, {
            fmt = 'P1DT1H/%V-W%W-%wT%h',
            buf = 'P1DT1H/2024-W31-3T17',
        }, {
            fmt = 'P1DT1H/%V-W%W-%wT%h:%m',
            buf = 'P1DT1H/2024-W31-3T17:42',
        }, {
            fmt = 'P1DT1H/%V-W%W-%wT%h:%m:%s',
            buf = 'P1DT1H/2024-W31-3T17:42:56',
        }, {
            fmt = 'P1DT1H/%V-W%W-%wT%h:%m:%.3s',
            buf = 'P1DT1H/2024-W31-3T17:42:56.132',
        }, {
            fmt = 'P1DT1H/%V-W%W-%wT%h:%mZ',
            buf = 'P1DT1H/2024-W31-3T14:42Z',
        }, {
            fmt = 'P1DT1H/%Y-%OT%h',
            buf = 'P1DT1H/2024-213T17',
        }, {
            fmt = 'P1DT1H/%Y-%OT%h:%m',
            buf = 'P1DT1H/2024-213T17:42',
        }, {
            fmt = 'P1DT1H/%Y-%OT%h:%m:%s',
            buf = 'P1DT1H/2024-213T17:42:56',
        }, {
            fmt = 'P1DT1H/%Y-%OT%h:%m:%.3s',
            buf = 'P1DT1H/2024-213T17:42:56.132',
        }, {
            fmt = 'P1DT1H/%Y-%OT%h:%mZ',
            buf = 'P1DT1H/2024-213T14:42Z',
        }, {
            fmt = 'R/%Y-%M-%D/P1Y',
            buf = 'R/2024-07-31/P1Y',
        }, {
            fmt = 'R/%V-W%W-%w/P1Y',
            buf = 'R/2024-W31-3/P1Y',
        }, {
            fmt = 'R/%Y-%O/P1Y',
            buf = 'R/2024-213/P1Y',
        }, {
            fmt = 'R/%Y-%M-%D/%Y-%M-%D',
            buf = 'R/2024-07-31/2024-07-31',
        }, {
            fmt = 'R/%Y-%M-%D/%V-W%W-%w',
            buf = 'R/2024-07-31/2024-W31-3',
        }, {
            fmt = 'R/%Y-%M-%D/%Y-%O',
            buf = 'R/2024-07-31/2024-213',
        }, {
            fmt = 'R/%V-W%W-%w/%Y-%M-%D',
            buf = 'R/2024-W31-3/2024-07-31',
        }, {
            fmt = 'R/%V-W%W-%w/%V-W%W-%w',
            buf = 'R/2024-W31-3/2024-W31-3',
        }, {
            fmt = 'R/%V-W%W-%w/%Y-%O',
            buf = 'R/2024-W31-3/2024-213',
        }, {
            fmt = 'R/%Y-%O/%Y-%M-%D',
            buf = 'R/2024-213/2024-07-31',
        }, {
            fmt = 'R/%Y-%O/%V-W%W-%w',
            buf = 'R/2024-213/2024-W31-3',
        }, {
            fmt = 'R/%Y-%O/%Y-%O',
            buf = 'R/2024-213/2024-213',
        }, {
            fmt = 'R10/%Y-%M-%D/P1Y',
            buf = 'R10/2024-07-31/P1Y',
        }, {
            fmt = 'R10/%V-W%W-%w/P1Y',
            buf = 'R10/2024-W31-3/P1Y',
        }, {
            fmt = 'R10/%Y-%O/P1Y',
            buf = 'R10/2024-213/P1Y',
        }, {
            fmt = 'R10/%Y-%M-%D/%Y-%M-%D',
            buf = 'R10/2024-07-31/2024-07-31',
        }, {
            fmt = 'R10/%Y-%M-%D/%V-W%W-%w',
            buf = 'R10/2024-07-31/2024-W31-3',
        }, {
            fmt = 'R10/%Y-%M-%D/%Y-%O',
            buf = 'R10/2024-07-31/2024-213',
        }, {
            fmt = 'R10/%V-W%W-%w/%Y-%M-%D',
            buf = 'R10/2024-W31-3/2024-07-31',
        }, {
            fmt = 'R10/%V-W%W-%w/%V-W%W-%w',
            buf = 'R10/2024-W31-3/2024-W31-3',
        }, {
            fmt = 'R10/%V-W%W-%w/%Y-%O',
            buf = 'R10/2024-W31-3/2024-213',
        }, {
            fmt = 'R10/%Y-%O/%Y-%M-%D',
            buf = 'R10/2024-213/2024-07-31',
        }, {
            fmt = 'R10/%Y-%O/%V-W%W-%w',
            buf = 'R10/2024-213/2024-W31-3',
        }, {
            fmt = 'R10/%Y-%O/%Y-%O',
            buf = 'R10/2024-213/2024-213',
        },
    }

}

local pg = t.group('pgroup')

-- XXX: It is not possible to use parameterization by passing a
-- table with test parameters to `t.group` because datetime format
-- strings in test parameters contains the symbol `/` that is not
-- allowed in testcases names. The source code below inserts
-- test functions into a test group with testnames where `/` is
-- replaced with `_`.
for supported_by, standard_cases in pairs(SUPPORTED_DATETIME_FORMATS) do
    for _, case in ipairs(standard_cases) do
        local f = case.fmt
        local testcase_name = 'test_supported_format_' .. f:gsub('/', '_')
        local fmtmsg = "Format '%s' supported by %s not parsed by %s"

        if supported_by == 'RFC3339 AND ISO8601' then
            local buf = case.buf

            pg[testcase_name] = function()
                local iso8601_ok, iso8601_val = pcall(dt.parse, buf,
                                                      {format = 'iso8601'})
                local rfc3339_ok, rfc3339_val = pcall(dt.parse, buf,
                                                      {format = 'rfc3339'})
                t.assert(iso8601_ok, fmtmsg:format(f, supported_by, 'iso8601'))
                t.assert(rfc3339_ok, fmtmsg:format(f, supported_by, 'rfc3339'))
                t.assert_equals(iso8601_val, rfc3339_val, 'unequal results')
            end
        else
            local dtfmt = supported_by:gsub(' ONLY', ''):lower()
            pg[testcase_name] = function()
                local ok, _ = pcall(dt.parse, case.buf, {format = dtfmt})
                t.assert(ok, fmtmsg:format(f, supported_by, dtfmt))
            end
        end
    end
end

for supported_by, standard_cases in pairs(UNSUPPORTED_DATETIME_FORMATS) do
    for _, case in ipairs(standard_cases) do
        local f = case.fmt
        local testcase_name = 'test_unsupported_format_' .. f:gsub('/', '_')
        local fmtmsg = "Unsupported by Tarantool format '%s' " ..
                       "supported by %s is parsed by %s"

        if supported_by == 'RFC3339 AND ISO8601' then
            local buf = case.buf
            pg[testcase_name] = function()
                local iso8601_ok, _ = pcall(dt.parse, buf, {format = 'iso8601'})
                local rfc3339_ok, _ = pcall(dt.parse, buf, {format = 'rfc3339'})
                t.assert(not iso8601_ok, fmtmsg:format(f, supported_by,
                                                       'iso8601'))
                t.assert(not rfc3339_ok, fmtmsg:format(f, supported_by,
                                                       'rfc3339'))
            end
        else
            local dtfmt = supported_by:gsub(' ONLY', ''):lower()
            pg[testcase_name] = function()
                local ok, _ = pcall(dt.parse, case.buf, {format = dtfmt})
                t.assert(not ok, fmtmsg:format(f, supported_by, dtfmt))
            end
        end
    end
end
