How to validate date and time in schema

import sys
from schema import BaseModel
from pydantic import Field,validator,EmailStr
from datetime import date, datetime
from typing import Optional

class CreateAppointmentSchema(BaseModel):
start_date : str

def validate_start_date(cls,v):
dateobjects = datetime.strptime(v,‘%d/%m/%y’)
return dateobjects
return ValueError(“wrong format”)

Please first read the pinned thread in order to understand how to post code so that it shows up properly.

Then, please actually explain why you are posting the code. Are you trying to show something off? Did something go wrong when you tried using the code? Something else?