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 $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
HelperDate
public HelperDate()
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