package com.red.circle.other.app.util;

import com.red.circle.tool.core.date.ZonedDateTimeAsiaRiyadhUtils;

import java.time.ZonedDateTime;

public class DateTimeAsiaRiyadhUtils {

  /**
   * 获取当前时间到凌晨的秒数
   * @return 秒数
   */
  public static long getSecondsUntilMidnight() {
    ZonedDateTime now = ZonedDateTimeAsiaRiyadhUtils.now();
    ZonedDateTime midnight = now.toLocalDate().plusDays(1).atStartOfDay(now.getZone());
    return java.time.Duration.between(now, midnight).getSeconds();
  }

}
