Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- asd = User.query.get(1)
- print(asd.created_at.strftime('%V'))
- >>> 07
- print('0' + str(int(datetime.now().isocalendar()[1])))
- >>> 07
- nnnn = User.query.filter(func.strftime('%V', User.created_at) == ('0' + str(datetime.now().isocalendar()[1]))).all()
- print(nnnn)
- >>> []
- if asd.created_at.strftime('%V') == ('0' + str(int(datetime.now().isocalendar()[1]))):
- print('yeah!')
- >>> yeah!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement