Java获得今日零时零分零秒的时间(Date型)
文章目录
public Date zeroTime() throws ParseException { Date time = new Date(); SimpleDateFormat simp= new SimpleDateFormat("yyyy-MM-dd 00:00:00"); SimpleDateFormat simp2= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); return simp2.parse(simp.format(time)); }
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论