deparser.py 文件源码

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

项目:FCParser 作者: josecamachop 项目源码 文件源码
def getUnstructuredTime (log, patern, dateFormat):

# Fuction to extrat timestamp from an unstructured source

    p = re.search(patern,log)
    try:
        date_string = p.group(0)
        d = datetime.strptime(date_string,dateFormat)
        d = d.replace(second = 00)

        return d.strftime(dateFormat)
    except:
        return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号