Write a java program to Validating Date Format

preview_player
Показать описание
Write a java program to Validating Date Format || Validate Time Format

Obtain a date string in the format dd/mm/yyyy. Write code to validate the given date against the given format.

The return type of the validate Date method is 1 if the given date format matches the specified format If the validation fails, return the output as -1.

Write a java program to validate the time format in Java.

Obtain a time string as input in the following format ‘hh:mm am’ or ‘hh:mm pm’. Write code to validate it using the following rules:

It should be a valid time in 12 hrs format.

It should have case insensitive AM or PM
Рекомендации по теме
Комментарии
Автор

Thanks a lot, just needed to understand that "match" method properly. Like deserved

davebalda
Автор

Thankyou Sir for the Video.!!!
One Doubt:
why we have to use Try catch here ?

yashjain