test.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:anki_progress_stats 作者: matthayes 项目源码 文件源码
def get_next_day_cutoff_seconds(hour):
  "Return the next cutoff for a particular hour as seconds since epoch."
  local_tz = tzlocal.get_localzone()
  dt_cutoff = local_tz.localize(datetime.now().replace(minute=0, second=0, microsecond=0, hour=hour))

  # TODO doesn't actually work.  if it is 1 am then it doens't chose 4 am of the same day.
  # dt_cutoff += timedelta(days=1)

  epoch = datetime(1970, 1, 1, tzinfo=pytz.utc)
  return (dt_cutoff - epoch).total_seconds()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号