Skip to content

Instantly share code, notes, and snippets.

/kaunis Secret

Created June 2, 2014 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/68d30355c7171b657f6f to your computer and use it in GitHub Desktop.
Save anonymous/68d30355c7171b657f6f to your computer and use it in GitHub Desktop.
try:
print "<h1 class=\"%s\">%s</h1>" % (print_date[:2],
print_date)
except:
import subprocess
env = os.environ.copy()
env["LANG"] = "fi_FI.UTF-8"
print_date = subprocess.check_output(["date", "+%c"],
env=env).decode("utf-8")
print_date = print_date.rsplit(" ",1)[0]
print "<h1 class=\"%s\">%s</h1>" % (print_date[:2], print_date)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment