Q:

Assume date manually - Updating date with own assumption

Basically I have the creation_date for some user in the format as follows:
    # Format creation date
    creation_date = datetime.datetime.strptime(creation_date, '%Y-%m-%d')   

So it will provide the creation date of user in the year-month-date format.
Then I need to take the date only (IE., %d) So I have taken the same as follows:
    # Get the day only
    creation_just_day = creation_date.day
    print creation_just_day

Now If the the particalar day is in following list I need to assume the day to '28', Which is done as follows:
    # Items need to consider for date consideration
    date_assume_list = [29,30,31]

    if creation_just_day in date_assume_list:
            creation_just_day = 28

Finally now I need to make the date as follows here using the above assignment.
So it should print the date as follows:
2016-01-28

A:

You can use the datetime.replace method. This method returns a new datetime object with one or more of the values of the original datetime object replaced. Of course, you can overwrite the original datetime object if you don't need it anymore.
For example,
import datetime

for creation_date in ('2016-02-05', '2016-01-29', '2015-12-31',): 
    creation_date = datetime.datetime.strptime(creation_date, '%Y-%m-%d')
    print '\nBefore:', creation_date
    if creation_date.day in (29, 30, 31):
        creation_date = creation_date.replace(day=28)
    print 'After: ', creation_date

output 
Before: 2016-02-05 00:00:00
After:  2016-02-05 00:00:00

Before: 2016-01-29 00:00:00
After:  2016-01-28 00:00:00

Before: 2015-12-31 00:00:00
After:  2015-12-28 00:00:00

