Fucius's picture
Upload 422 files
2eafbc4 verified
raw
history blame contribute delete
458 Bytes
from datetime import datetime, timedelta
TIMESTAMP_FORMAT = "%Y_%m_%d"
def generate_today_timestamp() -> str:
return datetime.today().strftime(TIMESTAMP_FORMAT)
def generate_start_timestamp_for_this_week() -> str:
today = datetime.today()
return (today - timedelta(days=today.weekday())).strftime(TIMESTAMP_FORMAT)
def generate_start_timestamp_for_this_month() -> str:
return datetime.today().replace(day=1).strftime(TIMESTAMP_FORMAT)