Here you can find the source of daysToYears(int days)
public static String daysToYears(int days)
//package com.java2s; //License from project: Apache License public class Main { public static String daysToYears(int days) { int years = days / 365; int leftOvers = days - (years * 365); String total = String.valueOf(years) + ":" + String.valueOf(leftOvers); return total; }/*from w w w . ja va 2s . c o m*/ }