So I have this code right now:
long diff = dateTwo.getTime() - dateOne.getTime();
long seconds = diff/1000;
long minutes = seconds/60;
long hours = minutes/60;
long days = hours/24;
long years = days/365;
And this gets me the elapsed time in minutes, seconds, days and years, but I want to have a timer that shows something like: Time passed - 1 year, 20 days, 5 minutes, 20 seconds. How can I make an algorithm that takes into account leap years and displays the numbers correctly?