Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Calendar cal = Calendar.getInstance();
- DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
- String str = dateFormat.format(cal.getTime());
- System.out.println(str);
- 2014/03/19 01:11:35
- preparedStatement.setTimestamp(new java.sql.Timestamp(cal.getTime()));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement