Guest User

Untitled

a guest
May 22nd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. public static void main(String[] args) throws Exception{
  2.  
  3.  
  4. String input = "2018/05/18 13:30:42 +00:00";
  5.  
  6. SimpleDateFormat parser = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
  7. Date date = parser.parse(input);
  8. SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd HH:mm:ssZ");
  9. String formattedDate = formatter.format(date);
  10.  
  11. System.out.println(formattedDate);
  12.  
  13. }
Add Comment
Please, Sign In to add comment