{"ScriptPreparationCode":"function isDateTime (str) {\r\n\t\t//\u7C97\u7565\u5730\u6838\u5C0D\u683C\u5F0F: \u0027yyyy/mm/dd\u0027 \u6216 \u0027yyyy/mm/dd HH:MM:SS\u0027\r\n\t\tconst len = str?.length;\t\r\n\t\tif (len !== 10 \u0026\u0026 len !== 19) return false;\r\n\t\tif (len \u003E 10 \u0026\u0026 (str[13] !== \u0027:\u0027 || str[16] !== \u0027:\u0027)) return false;\r\n\t\tif (str[4] !== \u0027/\u0027 || str[7] !== \u0027/\u0027) return false;\r\n\t\treturn false;\r\n\t\tif (len === 19) {\r\n\t\t\tconst d = str.substring(11).split(\u0027:\u0027).map(d =\u003E parseInt(d));\r\n\t\t\t\r\n\t\t\tif (d[0] \u003C 0 || 23 \u003C d[0] ||\r\n\t\t\t\td[1] \u003C 0 || 59 \u003C d[1] || \r\n\t\t\t\td[2] \u003C 0 || 59 \u003C d[2] ) return false;\r\n\t\t} \r\n\t\tconst d = str.split(\u0027/\u0027).map(d =\u003E parseInt(d));\r\n\t\treturn 0 \u003C d[1] \u0026\u0026 d[1] \u003C 13 \u0026\u0026 0 \u003C d[2] \u0026\u0026 d[2] \u003C 32;\r\n\t}\r\n\tconst isDateTime4 = str =\u003E {\r\n\t\t//\u7C97\u7565\u5730\u6838\u5C0D\u683C\u5F0F: \u0027yyyy/mm/dd\u0027 \u6216 \u0027yyyy/mm/dd HH:MM:SS\u0027\r\n\t\tconst len = str?.length;\t\r\n\t\tif (len !== 10 \u0026\u0026 len !== 19) return false;\r\n\t\tif (len \u003E 10 \u0026\u0026 (str[13] !== \u0027:\u0027 || str[16] !== \u0027:\u0027)) return false;\r\n\t\tif (str[4] !== \u0027/\u0027 || str[7] !== \u0027/\u0027) return false;\r\n\t\t\r\n\t\tif (len === 19) {\r\n\t\t\tconst d = str.substring(11).split(\u0027:\u0027);\r\n\t\t\t\r\n\t\t\tif (d[0] \u003C 0 || 23 \u003C d[0] ||\r\n\t\t\t\td[1] \u003C 0 || 59 \u003C d[1] || \r\n\t\t\t\td[2] \u003C 0 || 59 \u003C d[2] ) return false;\r\n\t\t} \r\n\t\tconst d = str.split(\u0027/\u0027);\r\n\t\treturn 0 \u003C d[1] \u0026\u0026 d[1] \u003C 13 \u0026\u0026 0 \u003C d[2] \u0026\u0026 d[2] \u003C 32;\r\n\t}\r\n\t\r\n\t//const isDateTime3 = str =\u003E /\\d{4}\\/\\d{2}\\/\\d{2}( \\d{2}:\\d{2}:\\d{2})?/.test(str)\r\nfunction isDateTime2 (str){\r\n return /\\d{4}\\/(0[1-9]|1[0-2])\\/([0-2]\\d|3[0,1])( ([0,1]\\d|2[0-3]):[0-5]\\d:[0-5]\\d)?$/.test(str);\r\n }","TestCases":[{"Name":"1","Code":"\r\n\tisDateTime(\u00272023/09/08 12:00:05\u0027); \r\n\tisDateTime(\u00272023/09/08\u0027); ","IsDeferred":false},{"Name":"2","Code":"\r\n\tisDateTime2(\u00272023/09/08 12:00:05\u0027); \r\n\tisDateTime2(\u00272023/09/08\u0027); ","IsDeferred":false}]}