PyZipline/pyzipline/utils.py
SeaswimmerTheFsh bd4a90a6be
Some checks failed
Pylint / Pylint (3.12) (push) Failing after 36s
adding docs for a whole bunch more stuff
2023-12-20 18:13:55 -05:00

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')