Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String subscribedDate="2012-09-28 11:00:00";
- String oldFormat = "yyyy-mm-dd hh:mm:ss";
- SimpleDateFormat sdf1 = new SimpleDateFormat(oldFormat);
- Date dates=sdf1.parse(subscribedDate);
- System.out.println(dates);
- //code for entering dates in database.
- String oldFormat = "yyyy-MM-dd hh:mm:ss";
- String subscribedDate="2012-09-28 11:00:00";
- String oldFormat = "yyyy-MM-dd hh:mm:ss";
- SimpleDateFormat sdf1 = new SimpleDateFormat(oldFormat);
- Date dates=sdf1.parse(subscribedDate);
- System.out.println(sdf1.format(dates));
- // code for entering dates in database.
- String oldFormat = "yyyy-MM-dd hh:mm:ss";
- oldFormat = "yyyy-MM-dd HH:mm:ss"; // hours counted 0~23
- oldFormat = "yyyy-MM-dd hh:mm:ss"; // hours counted 0~11
- String oldFormat = "yyyy-MM-dd hh:mm:ss";
Add Comment
Please, Sign In to add comment