PyZipline/pyzipline/utils.py
SeaswimmerTheFsh adfe6de1cf
All checks were successful
Pylint / Pylint (3.12) (push) Successful in 38s
fix: pylint fixes
2023-12-21 08:49:31 -05:00

13 lines
391 B
Python

"""This is a list of various utility functions used in PyZipline."""
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: String to convert
Returns:
datetime: Datetime object
"""
return datetime.strptime(date_string, '%Y-%m-%dT%H:%M:%S.%fZ')