Tag: valueconverter

在Java中将时间戳转换为日期

这是我的数据库: 在这里,我必须检查查询当前日期+状态= Q信息并获取计数值。 这是我的代码: 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 statement = con .prepareStatement(“select * from orders where status=’Q’ AND date=CURDATE()”); ResultSet result = […]