Java Calendar from Date getCalendar(Date date)

Here you can find the source of getCalendar(Date date)

Description

get Calendar

License

Open Source License

Declaration

static Calendar getCalendar(Date date) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2015 Open Software Solutions GmbH.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License v3.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/lgpl-3.0.html
 * //from   w  w  w.ja v a2 s. c  o  m
 * Contributors:
 *     Open Software Solutions GmbH
 ******************************************************************************/

import java.util.Calendar;
import java.util.Date;

public class Main {
    static Calendar getCalendar(Date date) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(date);
        return cal;
    }

    private static void setTime(Calendar cal, int hour, int minute, int second) {
        cal.set(Calendar.HOUR_OF_DAY, hour);
        cal.set(Calendar.MINUTE, minute);
        cal.set(Calendar.SECOND, second);
    }
}

Related

  1. dateToCalendar(int year, int month, int day)
  2. dateToCalendar(java.util.Date date)
  3. DateToCalendar(java.util.Date date)
  4. dateToCalendar(String date)
  5. getCalendar(Date date)
  6. getCalendar(Date date)
  7. getCalendar(Date date, int firstDayOfWeek)
  8. getCalendar(Date date, int step)
  9. getCalendar(Date dt)