Here you can find the source of asDate(Calendar calendar)
public static Date asDate(Calendar calendar)
//package com.java2s; //License from project: Apache License import java.time.OffsetDateTime; import java.util.Calendar; import java.util.Date; public class Main { public static Date asDate(Calendar calendar) { return new Date(calendar.getTimeInMillis()); }// w w w. j a v a2s . c o m public static Date asDate(OffsetDateTime offsetDateTime) { return new Date(offsetDateTime.toEpochSecond()); } }