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"格式的


腾讯云智研发成长空间 246人发布