import datetime
from datetime import date
import re
s = "Jason's birthday is on 1991-09-21"
match ='\d{4}-\d{2}-\d{2}', s)
date = datetime.datetime.strptime(, '%Y-%m-%d').date()
print date
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter