List of usage examples for java.util GregorianCalendar getTime
public final Date getTime()
Date
object representing this Calendar
's time value (millisecond offset from the Epoch"). From source file:Main.java
public static String getGiornoNumerio(GregorianCalendar cal) { return dfgiornoN.format(cal.getTime()); }
From source file:Main.java
public static String getGiornoLettere(GregorianCalendar cal) { return dfgiornoS.format(cal.getTime()); }
From source file:Main.java
public static Date getPresentDate() { GregorianCalendar g = new GregorianCalendar(); return g.getTime(); }
From source file:Main.java
public static String getStringFromCal(GregorianCalendar cal) { return cal != null ? dateFormat.format(cal.getTime()) : null; }
From source file:Main.java
/** * returns the string representation of the passed GregorianCalendar * in the appropriate format for the URL * @param _cal the calendar to use the date from * @return string representation of the passed date *///from w w w . ja v a 2 s . c o m public static String getUrlTimeString(GregorianCalendar _gc) { return getUrlTimeString(_gc.getTime()); }
From source file:Main.java
public static XMLGregorianCalendar gregorian2XMLGregorian(GregorianCalendar gc) { return long2XMLGregorian(gc.getTime().getTime()); }
From source file:Main.java
public static Date xmlGregorianCalendarToDate(XMLGregorianCalendar cal) throws DatatypeConfigurationException { GregorianCalendar gregorianCalendar = cal.toGregorianCalendar(); return gregorianCalendar.getTime(); }
From source file:Main.java
/** * Transform an XMLGregorianCalendar value to a Date value * /*from w w w . java 2 s .c o m*/ * @param xmlCal * @return <code>Date</code> */ public static Date gregorian2date(XMLGregorianCalendar xmlCal) { Date date = null; if (xmlCal != null) { GregorianCalendar c = xmlCal.toGregorianCalendar(); date = c.getTime(); } return date; }
From source file:Main.java
public static Date getDate(int year, int month, int day, int hour, int minute) { GregorianCalendar calendar = new GregorianCalendar(year, month - 1, day, hour, minute); return calendar.getTime(); }
From source file:DateUtils.java
public static Date getYesterday() { GregorianCalendar yesterday = new GregorianCalendar(); yesterday.add(Calendar.DATE, -1); return yesterday.getTime(); }