获取当天0点数据scala实现

2021-04-26 11:00:11 浏览数 (1)

项目要求统计0点前一天的统计量,每天定时进行spark任务,代码如下:

代码语言:javascript复制
val calendar: Calendar = Calendar.getInstance()
    calendar.set(Calendar.SECOND, 0)
    calendar.set(Calendar.MINUTE, 0)
    calendar.set(Calendar.HOUR_OF_DAY, 0)
    calendar.set(Calendar.MILLISECOND, 0)
    val hbaseTimeStopRow: Long = calendar.getTimeInMillis

0 人点赞