0

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?

2
Contributors
2
Replies
4
Views
6 Years
Discussion Span
Last Post by kuchi
1

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

0

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.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.