Advertisement
Guest User

Untitled

a guest
Apr 25th, 2014
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. Calendar cal = Calendar.getInstance();
  2. DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
  3. String str = dateFormat.format(cal.getTime());
  4. System.out.println(str);
  5.  
  6. 2014/03/19 01:11:35
  7.  
  8. preparedStatement.setTimestamp(new java.sql.Timestamp(cal.getTime()));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement