1.查询:注册时间为今天的所有用户数:

select count(*) from customer where TO_DAYS(createtime) = TO_DAYS(NOW())

2.获取当前时间到凌晨24点还有多长时间:(Java中可用于判断某时间是否为今天)

final Calendar cal = Calendar.getInstance();
    cal.set(Calendar.DAY_OF_MONTH, cal.get(Calendar.DAY_OF_MONTH) + 1);
    cal.set(Calendar.HOUR_OF_DAY, 0);
    cal.set(Calendar.MINUTE, 0);
    cal.set(Calendar.SECOND, 0);
    cal.set(Calendar.MILLISECOND, 0);
    final double diff = cal.getTimeInMillis() - System.currentTimeMillis();

 

相关文章:

  • 2021-04-01
  • 2022-12-23
  • 2021-08-14
  • 2022-12-23
  • 2022-02-12
  • 2021-11-30
  • 2021-07-20
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-31
  • 2021-06-03
  • 2022-12-23
  • 2022-12-23
  • 2020-05-11
  • 2022-01-13
相关资源
相似解决方案