Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) throws Exception{
- String input = "2018/05/18 13:30:42 +00:00";
- SimpleDateFormat parser = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
- Date date = parser.parse(input);
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd HH:mm:ssZ");
- String formattedDate = formatter.format(date);
- System.out.println(formattedDate);
- }
Add Comment
Please, Sign In to add comment