Here you can find the source of getTime(Date date)
Parameter | Description |
---|---|
date | date object |
public static Calendar getTime(Date date)
//package com.java2s; /*/*from w ww . j av a2 s . c o m*/ * Copyright 2013 Swedish E-identification Board (E-legitimationsn?mnden) * * Licensed under the EUPL, Version 1.1 or ? as soon they will be approved by the * European Commission - subsequent versions of the EUPL (the "Licence"); * You may not use this work except in compliance with the Licence. * You may obtain a copy of the Licence at: * * http://joinup.ec.europa.eu/software/page/eupl * * Unless required by applicable law or agreed to in writing, software distributed * under the Licence is distributed on an "AS IS" basis, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or * implied. * See the Licence for the specific language governing permissions and limitations * under the Licence. */ import java.util.Calendar; import java.util.Date; public class Main { /** * Derives a Calendar object from a millisecond time value * @param timeInMs milliseconds since Jan 1, 1970 * @return Calendar object of the provided time */ public static Calendar getTime(long timeInMs) { Calendar time = Calendar.getInstance(); time.setTimeInMillis(timeInMs); return time; } /** * Derives a Calendar object from a Date object * @param date date object * @return Calendar object */ public static Calendar getTime(Date date) { return getTime(date.getTime()); } }