converting timestamp to date in java
问题 This is my database: Here I have to check the query current date+status=Q information and get the count value. This is my code: public class TodayQ { public int data() { int count=0; Date date = new Date(timestamp); DateFormat dateFormat = new SimpleDateFormat ("yyyy-MM-dd"); System.out.println( dateFormat.format (date)); // count++; try { Class.forName("com.mysql.jdbc.Driver"); Connection con = DriverManager.getConnection( "jdbc:mysql://localhost:3306/pro", "root", ""); PreparedStatement