val-24skt7/schemas/servertime.py
2025-03-26 17:03:15 +00:00

17 lines
466 B
Python

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"
}
}