import datetime as dt from fastapi import FastAPI app = FastAPI() @app.get('/ping') def pong(): now = dt.datetime.now(dt.timezone.utc) return {"ping": "pong!", "now": now}