Imran_Mohammed

Date

Apr 21st, 2022
875
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1.  
  2. import java.text.DateFormat;
  3. import java.text.SimpleDateFormat;
  4. import java.util.Date;
  5.  
  6.  
  7. public class NewClass1 {
  8.    
  9.     public static void main(String[] args){
  10.        
  11.         Date date = new Date();
  12.        
  13.         DateFormat dateformat = new SimpleDateFormat("dd/MM/YYYY");
  14.         String currentDate = dateformat.format(date);
  15.         System.out.println(currentDate);
  16.        
  17.     }          
  18. }
  19.  
Advertisement
Add Comment
Please, Sign In to add comment