Here you can find the source of toDate(final Calendar calendar)
Parameter | Description |
---|---|
calendar | the calendar |
Parameter | Description |
---|---|
ParseException | the parse exception |
public static Date toDate(final Calendar calendar) throws ParseException
//package com.java2s; /*//w w w. j a va2 s .com * DateUtil.java * Copyright (c) 2014, EcoFactor, All Rights Reserved. * * This software is the confidential and proprietary information of EcoFactor * ("Confidential Information"). You shall not disclose such Confidential Information and shall use * it only in accordance with the terms of the license agreement you entered into with * EcoFactor. */ import java.text.ParseException; import java.util.Calendar; import java.util.Date; public class Main { /** * To date. * @param calendar the calendar * @return the date * @throws ParseException the parse exception */ public static Date toDate(final Calendar calendar) throws ParseException { Date date = new Date(); date = calendar.getTime(); return date; } }