__init__.py 文件源码

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

项目:onefl-deduper 作者: ufbmi 项目源码 文件源码
def format_date_as_string(val, fmt='%m-%d-%Y'):
    """
    :rtype str:
    :return the input value formatted as '%Y-%m-%d'

    :param val: datetime or string
    :param fmt: the input format for the date
    """
    if isinstance(val, date):
        return val.strftime(fmt)

    da = format_date(val, fmt)

    if not da:
        return ''

    return da.strftime(FORMAT_DATABASE_DATE)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号