org.sandev.basics.util
Class DateUtil

java.lang.Object
  extended byorg.sandev.basics.util.DateUtil

public class DateUtil
extends java.lang.Object

Common date manipulation utilities.


Constructor Summary
DateUtil()
           
 
Method Summary
static java.lang.String getQueryValue(java.util.Calendar cal)
          Return the query string format for this date value.
static java.lang.String getQueryValue(java.util.Date date)
          Convenience wrapper which gets a new Calendar instance for the given date before calling through to the calendar version of the same method.
static java.lang.String getShortFileDate(java.util.Calendar cal)
          Return a short date identifier useful for naming a file.
static java.lang.String getShortFileDate(java.util.Date date)
          Convenience wrapper which gets a new Calendar instance for the given date before calling through to the calendar version of the same method.
static java.lang.String getShortReadDate(java.util.Calendar cal)
          Return a short day-month-year representation that can be used as a prefix string when chronological ordering does not have to be the same as alphabetic ordering.
static java.lang.String getShortReadDate(java.util.Date date)
          Convenience wrapper which gets a new Calendar instance for the given date before calling through to the calendar version of the same method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateUtil

public DateUtil()
Method Detail

getShortReadDate

public static java.lang.String getShortReadDate(java.util.Date date)
Convenience wrapper which gets a new Calendar instance for the given date before calling through to the calendar version of the same method.


getShortReadDate

public static java.lang.String getShortReadDate(java.util.Calendar cal)
Return a short day-month-year representation that can be used as a prefix string when chronological ordering does not have to be the same as alphabetic ordering. This returns values like "27may05".


getShortFileDate

public static java.lang.String getShortFileDate(java.util.Date date)
Convenience wrapper which gets a new Calendar instance for the given date before calling through to the calendar version of the same method.


getShortFileDate

public static java.lang.String getShortFileDate(java.util.Calendar cal)
Return a short date identifier useful for naming a file. This is something like "2004_05_27" or "2004_11_09" so that a pile of these files will be ordered correctly via directory access.


getQueryValue

public static java.lang.String getQueryValue(java.util.Date date)
Convenience wrapper which gets a new Calendar instance for the given date before calling through to the calendar version of the same method.


getQueryValue

public static java.lang.String getQueryValue(java.util.Calendar cal)
Return the query string format for this date value. This is the quoted timestamp text format of the given date, which is used in query processing.