deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.framework.util
Class TimeTools

java.lang.Object
  extended by org.deegree.framework.util.TimeTools

public class TimeTools
extends Object

The TimeTools class can be used to format Strings to timecodes and get Calenadars of a given Timecode. Andreas Poth

Version:
$Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
last edited by: $Author: mschneider $

Field Summary
static int DAY
          A final Day representation
static int HOUR
          A final Hour representation
static int MILLISECOND
          A final MilliSecond representation
static int MINUTE
          A final Minute representation
static int MONTH
          A final Month representation
static int SECOND
          A final Second representation
static int YEAR
          A final Year representation
 
Constructor Summary
TimeTools()
           
 
Method Summary
static GregorianCalendar createCalendar(String isoDate)
          Notice that a Calendar does not consider milli seconds.
static Date createDate(String isoDate)
           
static String getISOFormattedTime()
           
static String getISOFormattedTime(Calendar cal)
           
static String getISOFormattedTime(Date date)
          returns the date calendar in ISO format
static String getISOFormattedTime(Date date, Locale locale)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

YEAR

public static final int YEAR
A final Year representation

See Also:
Constant Field Values

MONTH

public static final int MONTH
A final Month representation

See Also:
Constant Field Values

DAY

public static final int DAY
A final Day representation

See Also:
Constant Field Values

HOUR

public static final int HOUR
A final Hour representation

See Also:
Constant Field Values

MINUTE

public static final int MINUTE
A final Minute representation

See Also:
Constant Field Values

SECOND

public static final int SECOND
A final Second representation

See Also:
Constant Field Values

MILLISECOND

public static final int MILLISECOND
A final MilliSecond representation

See Also:
Constant Field Values
Constructor Detail

TimeTools

public TimeTools()
Method Detail

getISOFormattedTime

public static String getISOFormattedTime()
Returns:
the current timestamp in ISO format

getISOFormattedTime

public static String getISOFormattedTime(Date date)
returns the date calendar in ISO format

Parameters:
date -
Returns:
the date calendar in ISO format

getISOFormattedTime

public static String getISOFormattedTime(Date date,
                                         Locale locale)
Parameters:
date - the date object to get the time values of
locale - the locale to convert to
Returns:
the date calendar in ISO format considering the passed locale

getISOFormattedTime

public static String getISOFormattedTime(Calendar cal)
Parameters:
cal - a Calendar to get the timevalues of
Returns:
the passed calendar in ISO format

createCalendar

public static GregorianCalendar createCalendar(String isoDate)
                                        throws NumberFormatException
Notice that a Calendar does not consider milli seconds. This means 2008-09-22T12:31:00.999Z and 2008-09-22T12:31:00.111Z will return the same Calendar value!

Parameters:
isoDate - an ISO timestamp-> year-mon-dayThours:min:sec
Returns:
an instance of a GregorianCalendar from an ISO timestamp
Throws:
NumberFormatException - if the parsted values of the given String are no proper numbers.

createDate

public static Date createDate(String isoDate)
Parameters:
isoDate - an ISO timestamp-> year-mon-dayThours:min:sec.millis
Returns:
an instance of a java.util.Date from an ISO timestamp
Throws:
NumberFormatException - if the parsted values of the given String are no proper numbers.

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org