Last active
July 7, 2018 06:45
-
-
Save jibinpb/2d1585f2ca1f928b8eb6c4fa9d1b0c29 to your computer and use it in GitHub Desktop.
Extract Date from Text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dateutil.parser import parse | |
from dateutil.tz import gettz | |
from datetime import datetime | |
tzinfos = {"IST": gettz("Asia/Kolkata")} | |
for obj in (parse("Last Updated : Jan 23, 2018 12:13 PM IST | Source: Moneycontrol.com", fuzzy_with_tokens=True, tzinfos=tzinfos)): | |
if(isinstance(obj, datetime)): | |
print(obj) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment