|
Project Information
Links
|
Date converter module (JST,PST,EST) for Google App EngineUTC to PST or EST or JST license: public domain 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()
|