aqsj 发表于 2024-1-29 11:16:01

关于日期字段写入自建数据表的问题

如我所示,我需要存储的是一个“2024-01”这样格式的值,现在无法写入自建数据表,报错为“从您提供的日志信息中,似乎在解析日期 "2023-12" 时出现了问题。这个日期可能看起来不完整,因为通常我们期望的日期格式为 "yyyy-MM-dd"”,请问下咋整。在线等。。。

论坛管理员 发表于 2024-1-30 10:04:09

年月存储的是字符串,不是日期格式,您对应的自建表这个字段要用string类型,不能用日期类型

aqsj 发表于 2024-1-30 10:09:17

论坛管理员 发表于 2024-1-30 10:04
年月存储的是字符串,不是日期格式,您对应的自建表这个字段要用string类型,不能用日期类型 ...

好的谢谢

aqsj 发表于 2024-1-30 10:35:13

论坛管理员 发表于 2024-1-30 10:04
年月存储的是字符串,不是日期格式,您对应的自建表这个字段要用string类型,不能用日期类型 ...

虽然数据保存下来了 但是系统还是报了错误2024-01-30 10:29:14.221 ERROR com.x.query.assemble.surface.jaxrs.table.TableAction - id:444adf28-3052-4c34-816c-530163f0ac98, name:com.x.query.assemble.surface.jaxrs.table.TableAction, message:Unable to parse the date: 2024-01, exception:com.google.gson.JsonParseException, id:444adf28-3052-4c34-816c-530163f0ac98, name:com.x.query.assemble.surface.jaxrs.table.TableAction, message:Unable to parse the date: 2024-01, exception:com.google.gson.JsonParseException, person:cipher, method:POST, request:http://127.0.0.1/x_query_assemble_surface/jaxrs/table/jixiaoTable/row, remoteHost:127.0.0.1, emoteAddr:127.0.0.1, head:Cache-Control:no-cache, no-transform
Accept:text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Access-Control-Allow-Credentials:true
Access-Control-Allow-Methods:GET, POST, OPTIONS, PUT, DELETE, HEAD, TRACE
x-token:PXBzJV7ISkLfGtHA8SW6eZFOZ4yQaNraygGd-L0N0gg
User-Agent:Java/11.0.19
Connection:keep-alive
Host:127.0.0.1
Pragma:no-cache
Content-Length:385
Access-Control-Allow-Headers:x-requested-with, x-request, Content-Type, x-cipher, x-client, x-token

aqsj 发表于 2024-1-30 15:02:32

论坛管理员 发表于 2024-1-30 10:04
年月存储的是字符串,不是日期格式,您对应的自建表这个字段要用string类型,不能用日期类型 ...

已解决了谢谢 !!!

xadmin 发表于 2024-2-1 13:08:02

:handshake
页: [1]
查看完整版本: 关于日期字段写入自建数据表的问题