__init__.py 文件源码

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

项目:onefl-deduper 作者: ufbmi 项目源码 文件源码
def format_date(val, fmt='%m-%d-%Y'):
    """
    Transform the input string to a datetime object

    :param val: the input string for date
    :param fmt: the input format for the date
    """
    date_obj = None

    try:
        date_obj = datetime.strptime(val, fmt)
    except Exception as exc:
        log.warning("Problem formatting date: {} - {} due: {}"
                    .format(val, fmt, exc))

    return date_obj
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号