12 lines
339 B
Python
12 lines
339 B
Python
from datetime import datetime
|
|
|
|
def convert_str_to_datetime(date_string: str) -> datetime:
|
|
"""Converts a Zipline date string to a datetime object
|
|
|
|
Args:
|
|
date_string (str): String to convert
|
|
|
|
Returns:
|
|
datetime (datetime): Datetime object
|
|
"""
|
|
return datetime.strptime(date_string, '%Y-%m-%dT%H:%M:%S.%fZ')
|