SHARE
TWEET

Untitled

a guest Feb 17th, 2017 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. asd = User.query.get(1)
  2. print(asd.created_at.strftime('%V'))
  3. >>> 07
  4. print('0' + str(int(datetime.now().isocalendar()[1])))
  5. >>> 07
  6.  
  7. nnnn = User.query.filter(func.strftime('%V', User.created_at) == ('0' + str(datetime.now().isocalendar()[1]))).all()
  8. print(nnnn)
  9.  
  10. >>> []
  11.    
  12. if asd.created_at.strftime('%V') == ('0' + str(int(datetime.now().isocalendar()[1]))):
  13.     print('yeah!')
  14.    
  15. >>> yeah!
RAW Paste Data
Top