"""Print the results.""" from datetime import timedelta from mappings import Message, get_session session = get_session() msgs = session.query(Message).order_by(Message.timestamp.desc()).all() my_timezone = timedelta(hours=7) for msg in msgs: sent_at = msg.timestamp - my_timezone sent_at_str = sent_at.strftime("[%m-%d %H:%M]") text = msg.text[:70].replace("\n", "") print(f"{sent_at_str} {msg.username:^10} {msg.type:^8} {text}")