Python Parse String to DateTime

Descripción

Parse string to datetime using common formats


File Template: ❌


Prefix

datetime:parse


Scopes

python


Snippet de código

from datetime import datetime

${1:dt} = datetime.strptime(${2:datetime_string}, "${3|%Y-%m-%d %H:%M,%Y-%m-%d %H:%M:%S,%d/%m/%Y %H:%M,%d/%m/%Y %H:%M:%S,%m/%d/%Y %H:%M,%m/%d/%Y %H:%M:%S,%Y-%m-%dT%H:%M:%S|}")