from pydantic import BaseModel, Field from datetime import datetime class ServerTimeBase(BaseModel): current_time: datetime = Field(default_factory=datetime.now, description="Current server timestamp") class ServerTimeCreate(ServerTimeBase): pass class ServerTime(ServerTimeBase): class Config: orm_mode = True schema_extra = { "example": { "current_time": "2024-01-20T12:00:00.000Z" } }