daily pastebin goal
67%
SHARE
TWEET

views.py

a guest Jul 27th, 2012 1 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from django.http import Http404, HttpResponse
  2. import datetime
  3.  
  4. def hours_ahead(request, offset):
  5.         try:
  6.                 offset = int(offset)
  7.         except ValueError:
  8.                 raise Http404()
  9.         dt = datetime.datetime.now() + datetime.timedelta(hours=offset)
  10.         html = "<html><body>After %s hours will %s.</body></html>" % (offset, dt)
  11.         return HttpResponse(html)
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top