Here you can find the source of getTimeYYYYMMDD(Calendar calendar)
private static int getTimeYYYYMMDD(Calendar calendar)
//package com.java2s; /************************************************************************************** * Copyright (C) 2008 EsperTech, Inc. All rights reserved. * * http://esper.codehaus.org * * http://www.espertech.com * * ---------------------------------------------------------------------------------- * * The software in this package is published under the terms of the GPL license * * a copy of which has been included with this distribution in the license.txt file. * **************************************************************************************/ import java.util.Calendar; public class Main { private static int getTimeYYYYMMDD(Calendar calendar) { return 10000 * calendar.get(Calendar.YEAR) + (calendar.get(Calendar.MONTH) + 1) * 100 + calendar.get(Calendar.DAY_OF_MONTH); }/*from w w w . j av a 2 s .c om*/ }