org.esau.ptarmigan.util
Class HelperDate

java.lang.Object
  |
  +--org.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 $
Author:
Reed Esau

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
 

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
 
Returns:
null if no year could be extracted


Copyright © 2002 Reed Esau, All Rights Reserved.