Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

input date in java

import java.text.SimpleDateFormat;
import java.util.*;

class class_name
{
    public static void main(String[] args) throws Exception // You can also use try-catch blocks.
    {
      System.out.println("dd-mm-yyyy");
      Scanner scanner = new Scanner(System.in);
      String date = scanner.nextLine();
      Date date1=new SimpleDateFormat("dd-MM-yyyy").parse(date);  
      System.out.println(date1);
    }
}
 
PREVIOUS NEXT
Tagged: #input #date #java
ADD COMMENT
Topic
Name
5+9 =