Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.scopemvc.application.timewarp.utilities
Class DateUtility  view DateUtility download DateUtility.java

java.lang.Object
  extended byorg.scopemvc.application.timewarp.utilities.DateUtility

public class DateUtility
extends java.lang.Object

General utility for handling dates Can be used either by creating an instance with a java.util.Date in constructor argument, or by invoking the static methods, sending the java.util.Date as input argument.

Version:
1.0

Field Summary
private static java.util.Calendar cal
           
private  java.util.Date date
           
 
Constructor Summary
DateUtility(java.util.Date date)
          Constructor for the DateUtility object
 
Method Summary
static long currentDateToLong()
          TODO: document the method
 long dateToLong()
          Return the incoming date as number of milliseconds since 00:00:00.00 GMT Jan 1, 1970
static long dateToLong(java.util.Date inDate)
          Return the incoming date as number of milliseconds since 00:00:00.00 GMT Jan 1, 1970
private static java.util.Calendar getCalRef()
          private method getting the reference to a Calendar object This object is either created with the object is constructed, or at the time of the static call.
static java.lang.String getCurrentLongDate()
          Gets the current long date
static java.lang.String getCurrentMediumDate()
          Gets the current medium date
static java.lang.String getCurrentMonthYear()
          Gets the current month year
static java.lang.String getCurrentOracleDate()
          Gets the current oracle date
static java.lang.String getCurrentShortDate()
          Gets the current short date
static java.lang.String getCurrentTimeToMilliSeconds()
          Gets the current time to milli seconds
static java.lang.String getCurrentTimeToMinutes()
          Gets the current time to minutes
static java.lang.String getCurrentTimeToSeconds()
          Gets the current time to seconds
 java.lang.String getLongDate()
          Return the incoming in "long" form, as defined by the Locale in the DateFormat construction.
static java.lang.String getLongDate(java.util.Date inDate)
          Return the incoming in "long" form, as defined by the Locale in the DateFormat construction.
 java.lang.String getMediumDate()
          Return the incoming in "medium" form, as defined by the Locale in the DateFormat construction.
static java.lang.String getMediumDate(java.util.Date inDate)
          Return the incoming in "medium" form, as defined by the Locale in the DateFormat construction.
 java.lang.String getMonthYear()
          Return the incoming date in Month and Year Format: MM-YYYY uses date specified upon construction
static java.lang.String getMonthYear(java.util.Date inDate)
          Return the incoming date in Month and Year Format: MM-YYYY uses date specified upon construction
 java.lang.String getOracleDate()
          Return the incoming date in Oracle Format: MM-DD-YYYY uses date specified upon construction
static java.lang.String getOracleDate(java.util.Date inDate)
          Return the incoming date in Oracle Format: MM-DD-YYYY uses date specified upon construction
private  java.lang.String getShortDate()
          Return the incoming in "short" form, as defined by the Locale in the DateFormat construction: for US, the form is MM/DD/YY, e.g.
static java.lang.String getShortDate(java.util.Date inDate)
          Return the incoming in "short" form, as defined by the Locale in the DateFormat construction: for US, the form is MM/DD/YY, e.g.
 java.lang.String getTimeToMilliSeconds()
          Returns the time up the nearest 1/10 of a second
static java.lang.String getTimeToMilliSeconds(java.util.Date inDate)
          Returns the time up the nearest 1/10 of a second
 java.lang.String getTimeToMinutes()
          Returns the time up the the minutes, but, apparently, without rounding.
static java.lang.String getTimeToMinutes(java.util.Date inDate)
          Returns the time up the the minutes, but, apparently, without rounding.
 java.lang.String getTimeToSeconds()
          Returns the time up the the seconds, but, apparently, without rounding.
static java.lang.String getTimeToSeconds(java.util.Date inDate)
          Returns the time up the the seconds, but, apparently, without rounding.
static java.lang.String getYear(java.util.Date inDate)
          Return the incoming date Year Format: YYYY uses date specified upon construction
static void main(java.lang.String[] args)
          The main program for the DateUtility class
private static java.lang.String pad(int value)
          private method for padding a 0 to a single digit
private static java.lang.String pad(java.lang.String str)
          private method for padding a 0 to a decimal value < 10.000
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cal

private static java.util.Calendar cal

date

private java.util.Date date
Constructor Detail

DateUtility

public DateUtility(java.util.Date date)
Constructor for the DateUtility object

Method Detail

getOracleDate

public static java.lang.String getOracleDate(java.util.Date inDate)
Return the incoming date in Oracle Format: MM-DD-YYYY uses date specified upon construction


getCurrentOracleDate

public static java.lang.String getCurrentOracleDate()
Gets the current oracle date


getMonthYear

public static java.lang.String getMonthYear(java.util.Date inDate)
Return the incoming date in Month and Year Format: MM-YYYY uses date specified upon construction


getYear

public static java.lang.String getYear(java.util.Date inDate)
Return the incoming date Year Format: YYYY uses date specified upon construction


getCurrentMonthYear

public static java.lang.String getCurrentMonthYear()
Gets the current month year


getShortDate

public static java.lang.String getShortDate(java.util.Date inDate)
Return the incoming in "short" form, as defined by the Locale in the DateFormat construction: for US, the form is MM/DD/YY, e.g. 12/5/01


getCurrentShortDate

public static java.lang.String getCurrentShortDate()
Gets the current short date


getMediumDate

public static java.lang.String getMediumDate(java.util.Date inDate)
Return the incoming in "medium" form, as defined by the Locale in the DateFormat construction. For US, the form is, e.g., Dec 5, 2001


getCurrentMediumDate

public static java.lang.String getCurrentMediumDate()
Gets the current medium date


getLongDate

public static java.lang.String getLongDate(java.util.Date inDate)
Return the incoming in "long" form, as defined by the Locale in the DateFormat construction. For US, the form is, e.g., December 5, 2001


getCurrentLongDate

public static java.lang.String getCurrentLongDate()
Gets the current long date


getTimeToMinutes

public static java.lang.String getTimeToMinutes(java.util.Date inDate)
Returns the time up the the minutes, but, apparently, without rounding. Therefore, if the time is 12:45:55.995, this will come to 12:45


getCurrentTimeToMinutes

public static java.lang.String getCurrentTimeToMinutes()
Gets the current time to minutes


getTimeToSeconds

public static java.lang.String getTimeToSeconds(java.util.Date inDate)
Returns the time up the the seconds, but, apparently, without rounding. Therefore, if the time is 12:45:55.995, this will come to 12:45:55


getCurrentTimeToSeconds

public static java.lang.String getCurrentTimeToSeconds()
Gets the current time to seconds


getTimeToMilliSeconds

public static java.lang.String getTimeToMilliSeconds(java.util.Date inDate)
Returns the time up the nearest 1/10 of a second


getCurrentTimeToMilliSeconds

public static java.lang.String getCurrentTimeToMilliSeconds()
Gets the current time to milli seconds


dateToLong

public static long dateToLong(java.util.Date inDate)
Return the incoming date as number of milliseconds since 00:00:00.00 GMT Jan 1, 1970


currentDateToLong

public static long currentDateToLong()
TODO: document the method


main

public static void main(java.lang.String[] args)
The main program for the DateUtility class


getCalRef

private static java.util.Calendar getCalRef()
private method getting the reference to a Calendar object This object is either created with the object is constructed, or at the time of the static call.


pad

private static java.lang.String pad(int value)
private method for padding a 0 to a single digit


pad

private static java.lang.String pad(java.lang.String str)
private method for padding a 0 to a decimal value < 10.000


getOracleDate

public java.lang.String getOracleDate()
Return the incoming date in Oracle Format: MM-DD-YYYY uses date specified upon construction


getMonthYear

public java.lang.String getMonthYear()
Return the incoming date in Month and Year Format: MM-YYYY uses date specified upon construction


getMediumDate

public java.lang.String getMediumDate()
Return the incoming in "medium" form, as defined by the Locale in the DateFormat construction. For US, the form is, e.g., Dec 5, 2001


getLongDate

public java.lang.String getLongDate()
Return the incoming in "long" form, as defined by the Locale in the DateFormat construction. For US, the form is, e.g., December 5, 2001


getTimeToMinutes

public java.lang.String getTimeToMinutes()
Returns the time up the the minutes, but, apparently, without rounding. Therefore, if the time is 12:45:55.995, this will come to 12:45


getTimeToSeconds

public java.lang.String getTimeToSeconds()
Returns the time up the the seconds, but, apparently, without rounding. Therefore, if the time is 12:45:55.995, this will come to 12:45:55


getTimeToMilliSeconds

public java.lang.String getTimeToMilliSeconds()
Returns the time up the nearest 1/10 of a second


dateToLong

public long dateToLong()
Return the incoming date as number of milliseconds since 00:00:00.00 GMT Jan 1, 1970


getShortDate

private java.lang.String getShortDate()
Return the incoming in "short" form, as defined by the Locale in the DateFormat construction: for US, the form is MM/DD/YY, e.g. 12/5/01