skipter

1000 Days on Earth

Apr 4th, 2017
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4. import java.time.format.*;
  5. import java.time.LocalDate;
  6.  
  7. public class date1 {
  8.  
  9.         public static void main(String[] agruments) {
  10.             Scanner input = new Scanner(System.in);
  11.             DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy");
  12.             String text = input.nextLine();
  13.             LocalDate parsedDate = LocalDate.parse(text, formatter);
  14.             LocalDate after1K = parsedDate.plusDays(999);
  15.             System.out.println(after1K.format(formatter));
  16.  
  17.         }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment