how to rewrite minute in datetime python
from datetime import datetime
date = datetime.strptime('26 Sep 2012', '%d %b %Y')
newdate = date.replace(hour=11, minute=59)
how to rewrite minute in datetime python
from datetime import datetime
date = datetime.strptime('26 Sep 2012', '%d %b %Y')
newdate = date.replace(hour=11, minute=59)
python set day of date to 1
from datetime import datetime
your_date = datetime.strptime('26 June 2021', '%d %b %Y')
# Using the .replace() method:
newdatetime = your_date.replace(day=1)
# 2021-06-01 00:00:00
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us