maghrib=answer_box[0]['magrib'] isya=answer_box[0]['isya'] # make the value above to datetime, from (05.20) to (05:20) subuh=datetime.datetime.strptime(subuh,'%H.%M').strftime('%H:%M') dzuhur=datetime.datetime.strptime(dzuhur,'%H.%M').strftime('%H:%M') ...