Guest User

Untitled

a guest
Jan 16th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. String subscribedDate="2012-09-28 11:00:00";
  2. String oldFormat = "yyyy-mm-dd hh:mm:ss";
  3. SimpleDateFormat sdf1 = new SimpleDateFormat(oldFormat);
  4. Date dates=sdf1.parse(subscribedDate);
  5. System.out.println(dates);
  6. //code for entering dates in database.
  7.  
  8. String oldFormat = "yyyy-MM-dd hh:mm:ss";
  9.  
  10. String subscribedDate="2012-09-28 11:00:00";
  11. String oldFormat = "yyyy-MM-dd hh:mm:ss";
  12. SimpleDateFormat sdf1 = new SimpleDateFormat(oldFormat);
  13. Date dates=sdf1.parse(subscribedDate);
  14. System.out.println(sdf1.format(dates));
  15. // code for entering dates in database.
  16.  
  17. String oldFormat = "yyyy-MM-dd hh:mm:ss";
  18.  
  19. oldFormat = "yyyy-MM-dd HH:mm:ss"; // hours counted 0~23
  20.  
  21. oldFormat = "yyyy-MM-dd hh:mm:ss"; // hours counted 0~11
  22.  
  23. String oldFormat = "yyyy-MM-dd hh:mm:ss";
Add Comment
Please, Sign In to add comment