Skip to content

Instantly share code, notes, and snippets.

@mcotton
Created February 4, 2016 15:52
Show Gist options
  • Save mcotton/e254caf04c166874c7bb to your computer and use it in GitHub Desktop.
Save mcotton/e254caf04c166874c7bb to your computer and use it in GitHub Desktop.
Working with dates in arrow and gae
# reference issue for making it work on GAE
# https://github.com/crsmithdev/arrow/issues/240
import os
import pprint
from google.appengine.api import memcache
from google.appengine.api import mail
from google.appengine.api import urlfetch
from google.appengine.ext import ndb
from google.appengine.api import search
from core.models import *
import datetime
import arrow
import datetime
TZ = 'US/Central'
#u = User.get_by_id(5865619656278016)
u = User.query(User.email=="blah@huvrdata.com").fetch(1)
ll = arrow.get(u[0].last_login)
pprint.pprint(u[0].last_login)
pprint.pprint(str(ll.to(TZ)))
pprint.pprint(ll.humanize())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment