Advertisement
Guest User

Untitled

a guest
May 25th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. package neuro;
  2.  
  3. public class Teste {
  4.  
  5.     public static void main(String[] args) {
  6.         java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("dd/MM/yyyy HH:mm:ss.SSS");
  7.         sdf.setTimeZone(java.util.TimeZone.getTimeZone("GMT -02:00"));
  8.         java.util.Date date;
  9.         try {
  10.             date = sdf.parse("24/05/2018 16:59:56.289");
  11.             System.out.println("Diferença em millisegundos: "+date.getTime());
  12.         } catch (java.text.ParseException e1) {
  13.             e1.printStackTrace();
  14.         }
  15.     }
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement