how can I set a month date to appear with last day of month. Currently I have
2008-01-01 for January
but I want it
2008-01-31.
Thanks in advance
how can I set a month date to appear with last day of month. Currently I have
2008-01-01 for January
but I want it
2008-01-31.
Thanks in advance
Use replace of datetime module
import datetime
datetime.datetime.strptime('2008-01-01','%Y-%d-%m').replace(day=31)