天天看點

Java轉化時間戳

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try{
    Date time = sdf.parse(sdf.format(要轉化的時間))
    System.out.println(time.getTime()/1000);
}catch(){
    
}