Venciity

[SoftUni Java] Introduction - 05.CurrentDateTime

May 6th, 2014
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1. import java.text.DateFormat;
  2. import java.text.SimpleDateFormat;
  3. import java.time.LocalDateTime;
  4. import java.util.Date;
  5. public class CurrentDateTime {
  6.    
  7.     public static void main(String[] args) {
  8.        
  9.         //DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
  10.         DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
  11.         Date date = new Date();
  12.         System.out.println(dateFormat.format(date));
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment