似乎我用这个方法从字符串创建日期时间是错误的,你知道为什么吗?前提条件在date_time_valid: date_time_valid (s, code)上违反
create l_date_time.make_from_string ("2019-03-28T15:28:02Z", "yyyy-mm-ddThh:mi:ssZ")发布于 2019-03-30 00:31:19
根据documentation,字符'T'和'Z'不是有效的格式说明符。因此,需要将它们替换为有效的,并相应地更改格式字符串:
s := "2019-03-28T15:28:02Z"
s.replace_substring_all ("T", " ")
s.replace_substring_all ("Z", "")
create t.make_from_string (s, "yyyy-mm-dd hh:mi:ss")https://stackoverflow.com/questions/55416965
复制相似问题