Hi, We have a date input come in the format of YYYYMMDD,
ex: if the date comes as 19980224, then its good
else if the date comes as 19982402, then we need to raise exception
we need to validate this date format. can you please guide me how to do this?

One hint.

import time

date = 19980224
print time.strptime(date, '%Y%m%d')

date = 19982402
print time.strptime(date, '%Y%m%d')

Cheers and Happy coding

Hey Slayer, in fact I also got this hint and I appreciate your reply and waiting looking forwarded to other answers for my future questions.