gpt4 book ai didi

java - 如何转换富:calender date to mysql Date

转载 作者:行者123 更新时间:2023-11-30 01:13:32 26 4
gpt4 key购买 nike

我正在尝试将 rich:calendar 日期转换为 mysql 日期。

并且在处理程序 empDOJ 中是 Date 类型。当我尝试通过 SimpleDateFormat 转换它时,它没有转换。

SimpleDateFormat sdf=new SimpleDateFormat("yyyy/mm/dd");
Date conDate=sdf.parse("doj");

最佳答案

SimpleDateFormat sdf=new SimpleDateFormat("yyyy/MM/dd");
Date conDate=sdf.parse(doj);

而不是

SimpleDateFormat sdf=new SimpleDateFormat("yyyy/mm/dd");
Date conDate=sdf.parse("doj");

mm 表示分钟MM 表示

关于java - 如何转换富:calender date to mysql Date,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19269468/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com