es_interface.py 文件源码

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

项目:ccdb5-api 作者: cfpb 项目源码 文件源码
def _min_valid_time():
    # show notification starting fifth business day data has not been updated
    # M-Th, data needs to have been updated 6 days ago; F-S, preceding Monday
    now = _get_now()
    weekday = datetime.weekday(now)
    # When bigger than 3, it means it is a Friday/Saturday/Sunday,
    # we can use the weekday integer to get 4 days ago without the need to
    # worry about hitting the weekend.  Else we need to include the weekend
    delta = weekday if weekday > 3 else 6
    return (now - timedelta(delta)).strftime("%Y-%m-%d")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号