Wednesday , 18 January 2017
Home » Date Related Programs

Date Related Programs

Java Program for finding Weekday name of the given date

Write a program to accept a date in the string format dd/mm/yyyy and accept the name of the day on 1st of January of the corresponding year. Find the day for the given date. Example: INPUT: Date : 5/7/2001 Day on 1st January : MONDAY OUTPUT: Day on 5/7/2001 : THURSDAY

Read More »

Java Program for finding Future Date

Write a program to accept a date in the string format dd/mm/yyyy. Check whether the date entered is valid or not. If it is valid, then input a certain number of days. Then calculate and print the future date after adding the given number of days if the future date is valid. If the date entered is invalid, then display a proper error message. Example: INPUT: Date : 07 / 04 / 2013 Enter Number of days after : 7 OUTPUT: Entered Date : 07 / 04 / 2013 Future Date : 14 / 04 / 2013

Read More »

Java Program for finding Difference between 2 Dates

Write a program to accept 2 dates in the string format dd/mm/yyyy and find the difference in days between the 2 dates. Example: INPUT: Date 1 : 20/12/2012 Date 2 : 11/02/2013 OUTPUT: Difference = 54 days The program should include the part for validating the inputs namely the date and the day on 1st January of that year.

Read More »