Skip to content

Instantly share code, notes, and snippets.

@nloadholtes
Created October 1, 2017 17:44
Show Gist options
  • Save nloadholtes/d8ae1ebe89bd8a13698db2580041786f to your computer and use it in GitHub Desktop.
Save nloadholtes/d8ae1ebe89bd8a13698db2580041786f to your computer and use it in GitHub Desktop.
Create a URL based on today's date
from datetime import datetime
class MagicURL(object):
def __init__(self, base_url):
self.base_url = base_url
def __str__(self):
today = datetime.today()
return self.base_url + "/" + today.strftime("%Y-%m-%d")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment