Java Date Create toDate(final Calendar calendar)

Here you can find the source of toDate(final Calendar calendar)

Description

To date.

License

Open Source License

Parameter

Parameter Description
calendar the calendar

Exception

Parameter Description
ParseException the parse exception

Return

the date

Declaration

public static Date toDate(final Calendar calendar) throws ParseException 

Method Source Code


//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;
    }
}

Related

  1. timeToDate()
  2. toDate()
  3. toDate()
  4. toDate(Calendar date)
  5. toDate(Date d)
  6. toDate(final Date date)
  7. toDate(int date)
  8. toDate(int flag, Date... date)
  9. toDate(long lastModified)