Create program, which will calculate number of days between two dates. The program has to accordance with the leap-years (do not ignore leap-years). You must NOT use any libraries to calculate the number of days, you can use them just to verify results. Input data: The program reads one line from standard input (=argument of command line). The String format: dd.mm.yyyy-dd.mm.yyyy (d-day, m-month, y-year) Example: $java cz.vutbr.fit.ijae1.xhruba03.TestBench 10.01.0823-06.12.1983 Wrong input: If the user enters incorrect format of the input data â?? the program writes an error message to the standard output. (The program will not be interrupted!) Output data: The program writes one line to the standard output. The line contains number of days between specified dates. Example: $12354
Check the tutorial Date Difference.
Look for the code:
long diffDays = diff / (24 * 60 * 60 * 1000);
Though above code you can get the difference.
thanks but i have problem in this task i cant use libaries and i dont understand how i must do this!!!