helpers.py 文件源码

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

项目:gitnet 作者: networks-lab 项目源码 文件源码
def make_utc_date(dict):
    """
    Takes an attribute dictionary. If "date" present, returns "YYYY-MM-DD" in Coordinated Universal Time.
    Otherwise, returns None. "date" must be a git-formatted string, e.g. 'Mon Apr 18 00:59:02 2016 -0400'.

    **Parameters**:

    > *dict* : `dict`

    >> An attribute dictionary.

    **Return** `string` or `none`
    """
    if "date" in dict:
        git_dt = datetime_git(dict["date"]).astimezone(dt.timezone(dt.timedelta(0)))
        return git_dt.strftime("%Y-%m-%d")
    else:
        return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号