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日

评论

h
hw_7864

⭐️ Admin快速开发: https://show.cool-admin.com/

赞 0
h
hw_7864

⭐️ 官方文档: https://cool-js.com

赞 0
h
hw_7864

⭐️ chatgpt在线体验: https://cool-js.com/ai/chat-vip/index.html?r=helloworld

赞 0