Advertisement
Guest User

Untitled

a guest
Feb 17th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  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!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement