获取当天00:00:00和23:59:59时间毫秒数

//当前时间毫秒数
long current=System.currentTimeMillis();
//今天零点零分零秒的毫秒数
long zeroTime=current/(1000x3600x24)x(1000x3600x24)- TimeZone.getDefault().getRawOffset();
String zero = new SimpleDateFormat(“yyyy-MM-dd HH:mm:ss”).format(zeroTime);
//今天23点59分59秒的毫秒数
long endTime=zeroTime+24x60x60x1000-1;
String end = new SimpleDateFormat(“yyyy-MM-dd HH:mm:ss”).format(endTime);

猜你喜欢

转载自blog.csdn.net/weixin_43524361/article/details/103719255
00