格林威治时间格式转时间戳

public class DemoMD5 {
   public static void main(String[] args) throws Exception {
      String strDate = "2019-11-25T09:51:40.527Z";
      SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss'.'sss'Z'");
      Date datetime = sdf.parse(strDate);
      System.out.println(datetime);
      long time = datetime.getTime();
     
      System.out.println(time);

      }

}

你可能感兴趣的:(jav基础)