java处理数据库日期
文章目录
从数据库中取出时间字段后的处理:
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
System.out.println(sdf.format("2014-11-28 01:37:47"));
处理结果:
数据库日期格式:2014-11-28 01:37:47
转换之后的格式:2014年12月28日
从数据库中取出时间字段后的处理:
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
System.out.println(sdf.format("2014-11-28 01:37:47"));
处理结果:
数据库日期格式:2014-11-28 01:37:47
转换之后的格式:2014年12月28日
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册⭐️ Admin快速开发: https://show.cool-admin.com/
赞 0⭐️ 官方文档: https://cool-js.com
赞 0⭐️ chatgpt在线体验: https://cool-js.com/ai/chat-vip/index.html?r=helloworld
赞 0