Here you can find the source of getDate(Date value)
Parameter | Description |
---|---|
value | the value |
public static long getDate(Date value)
//package com.java2s; //License from project: Open Source License import java.sql.Timestamp; import java.util.Date; public class Main { /**/*w w w. j a v a 2 s .com*/ * Gets the date. * * @param value * the value * * @return the date */ public static long getDate(Date value) { return value == null ? -1 : value.getTime(); } /** * Gets the date. * * @param value * the value * * @return the date */ public static Date getDate(long value) { return value > 0 ? new Date(value) : null; } /** * Gets the date. * * @param date * the date * * @return the date */ public static Date getDate(Timestamp date) { return date == null ? null : new Date(date.getTime()); } }