Run »
import datetime x = datetime.datetime.now() print(x.strftime("%p"))