Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
taux1c
GitHub Repository: taux1c/onlyfans-scraper
Path: blob/main/onlyfans_scraper/utils/dates.py
961 views
1
r"""
2
_ __
3
___ _ __ | | _ _ / _| __ _ _ __ ___ ___ ___ _ __ __ _ _ __ ___ _ __
4
/ _ \ | '_ \ | || | | || |_ / _` || '_ \ / __| _____ / __| / __|| '__| / _` || '_ \ / _ \| '__|
5
| (_) || | | || || |_| || _|| (_| || | | |\__ \|_____|\__ \| (__ | | | (_| || |_) || __/| |
6
\___/ |_| |_||_| \__, ||_| \__,_||_| |_||___/ |___/ \___||_| \__,_|| .__/ \___||_|
7
|___/ |_|
8
"""
9
10
from datetime import datetime
11
12
13
def convert_date_to_mdyhms(date: str):
14
datetime_obj = datetime.fromisoformat(date)
15
return datetime_obj.strftime('%B %d, %Y %I:%M:%S %p')
16
17
18
def convert_date_to_mdy(date: str):
19
datetime_obj = datetime.fromisoformat(date)
20
return datetime_obj.strftime('%B %d, %Y')
21
22
23
def convert_date_to_timestamp(date: str):
24
datetime_obj = datetime.fromisoformat(date)
25
return datetime_obj.timestamp()
26
27