java将日期时间CST格式转为"yyyy-MM-dd HH:mm:ss"

Date testDateStart = new DateTime().plusSeconds(120).toDate();
Date testDateEnd = new DateTime().plusSeconds(180).toDate();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String testDateStartStr = sdf.format(testDateStart);
String testDateEndStr = sdf.format(testDateEnd);

testDateStart直接存到数据库里面就是"yyyy-MM-dd HH:mm:ss"格式的

全部评论

相关推荐

青春运维少年不会梦到...:实习大王
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务