How can I extract hours and minutes from a datetime.datetime object? January 2, 2023 by Tarik I don’t know how you want to format it, but you can do: print("Created at %s:%s" % (t1.hour, t1.minute)) for example.