pacozaa

DateTimeNowExampleJava

Jun 17th, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. import java.text.SimpleDateFormat;
  2. import java.util.Date;
  3.  
  4. public class MainClass {
  5. public static void main(String[] args) {
  6. String pattern = "dd/MM/yyyy";
  7. SimpleDateFormat format = new SimpleDateFormat(pattern);
  8. // formatting
  9. System.out.println(format.format(new Date()));
  10. }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment