First, I do not know whether your time data has been in datatime object, or still in string. If you have not, you could convert from string to datetime by the following code (suppose that your first column name 'time_in' and second column name 'time_out', and the data variable name data)
from datetime import datetime
data['time_in'] = data['time_in'].apply(lambda x: datetime.strptime(x, "%I%p"))
data['time_out'] = data['time_out'].apply(lambda x: datetime.strptime(x, "%I%p"))
(one note: as you give me your time at Hour_locale like 8am, so I do not include minute in converter. If you do have minute, then "%I%p" should be changed into "%I:M%p"). You could view all time format to convert here, for any future usage https://www.programiz.com/python-programming/datetime/strptime
When you print out your data at this stage, you could see the time will have the format of 1900/01/01 18:00:00 (convert from 6pm, for example). Do not worry, as you see this simply because when converting, the library do not receive date, so it automatically assigned to the first one. Just remind that for next step.
Now, you apply the changing to dataframe, simply as this:
To change all login to 8am:
data.loc[(data['time_in']< datetime(year=1900,month=1,day=1,hour=8)) & (data['time_in'] > datetime(year=1900,month=1,day=1,hour=0)),'time_in'] = datetime(year=1900,month=1,day=1,hour=8)
To change all logout to 12am:
data.loc[(data['time_out']< datetime(year=1900,month=1,day=1,hour=8)) & (data['time_out'] > datetime(year=1900,month=1,day=1,hour=0)),'time_out'] = datetime(year=1900,month=1,day=1,hour=0)
Then, it will all set at this stage. If you want to convert back to string, using strftime() with similar usage to strptime