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

Quick Search    Search Deep

org.esau.ptarmigan.util
Class HelperDate  view HelperDate download HelperDate.java

java.lang.Object
  extended byorg.esau.ptarmigan.util.HelperDate

public final class HelperDate
extends java.lang.Object

Some static methods related to use of Dates

Version:
$Revision: 1.1 $ $Date: 2002/09/10 06:24:34 $

Field Summary
(package private) static java.text.DateFormat iso_8601_date_only
           
(package private) static java.text.DateFormat iso_8601_date_time
           
(package private) static int m_current_year
          the current year
 
Constructor Summary
HelperDate()
           
 
Method Summary
static java.lang.String epochtoIso8601(long date, boolean date_only)
          Create an ISO-8601 date string from the long, which is the number of msecs since the epoch.
static java.lang.String extractYear(java.lang.String val)
          attempt to extract a valid year from a 2 or 4 digit string Example:
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iso_8601_date_time

static final java.text.DateFormat iso_8601_date_time

iso_8601_date_only

static final java.text.DateFormat iso_8601_date_only

m_current_year

static int m_current_year
the current year

Constructor Detail

HelperDate

public HelperDate()
Method Detail

epochtoIso8601

public static java.lang.String epochtoIso8601(long date,
                                              boolean date_only)
Create an ISO-8601 date string from the long, which is the number of msecs since the epoch.


extractYear

public static java.lang.String extractYear(java.lang.String val)
attempt to extract a valid year from a 2 or 4 digit string Example:
    "65" is returned as 1965
    "01" is returned as 2001  (if year is 2002)
    "02" is returned as 2002  (if year is 2002)
    "03" is returned as 2003  (if year is 2002)
    "04" is returned as 2004  (if year is 2002)
    "05" is returned as 1905  (if year is 2002)
    "06" is returned as 1906  (if year is 2002)
    "1965" is returned as 1965
    "2015" is returned as 2015