mirror of
https://github.com/andrewkdinh/fund-indicators.git
synced 2024-11-21 19:34:22 -08:00
16 lines
459 B
Python
16 lines
459 B
Python
# Python file for general functions
|
|
class Functions:
|
|
def getNearest(items, pivot):
|
|
return min(items, key=lambda x: abs(x - pivot))
|
|
def stringToDate(date):
|
|
from datetime import datetime
|
|
#datetime_object = datetime.strptime('Jun 1 2005 1:33PM', '%b %d %Y %I:%M%p')
|
|
datetime_object = datetime.strptime(date, '%Y-%m-%d').date()
|
|
return(datetime_object)
|
|
|
|
def main():
|
|
exit()
|
|
|
|
if __name__ == "__main__":
|
|
main()
|