SHARE
TWEET

Untitled

a guest Jan 16th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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";
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top