Here you can find the source of getDecimalYear(Calendar calendar)
public static double getDecimalYear(Calendar calendar)
//package com.java2s; /**/*from w ww . j a v a 2 s .c o m*/ * Copyright (c) 2010-2017 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ import java.util.Calendar; public class Main { /** * Returns the year of the calendar object as a decimal value. */ public static double getDecimalYear(Calendar calendar) { return calendar.get(Calendar.YEAR) + (double) calendar.get(Calendar.DAY_OF_YEAR) / calendar.getActualMaximum(Calendar.DAY_OF_YEAR); } }