My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Links

Date converter module (JST,PST,EST) for Google App Engine

UTC to PST or EST or JST

license:

public domain

example:

Copy DateConvModule.py to your directory

(time.htm)

PST: [{{t|toPst|date:"m/d H:i"}}]

(test.py)

import datetime
import wsgiref.handlers
import os
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template

class TimePage(webapp.RequestHandler):
  def get(self):

    template.register_template_library('DateConvModule')

    template_values = {
      't': datetime.datetime.now()
    }
    path = os.path.join(os.path.dirname(__file__), 'template.htm')
    self.response.out.write(template.render(path, template_values))

application = webapp.WSGIApplication([
  ('/', TimePage)
], debug=True)

def main():
  wsgiref.handlers.CGIHandler().run(application)

if __name__ == '__main__':
  main()
Powered by Google Project Hosting