With datetime objects, you can use .format
in a special way:
from datetime import datetime
'{:%Y-%m-%d %H:%M}'.format(datetime(1990, 4, 28, 22, 30))
Those are the usual formatters for datetime objects.
Can I give any class such custom ways to format them? How?