deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.framework.util
Class TimeTools

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

public class TimeTools
extends java.lang.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 java.util.GregorianCalendar createCalendar(java.lang.String isoDate)
          Notice that a Calendar does not consider milli seconds.
static java.util.Date createDate(java.lang.String isoDate)
           
static java.lang.String getISOFormattedTime()
           
static java.lang.String getISOFormattedTime(java.util.Calendar cal)
           
static java.lang.String getISOFormattedTime(java.util.Date date)
          returns the date calendar in ISO format
static java.lang.String getISOFormattedTime(java.util.Date date, java.util.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 java.lang.String getISOFormattedTime()
Returns:
the current timestamp in ISO format

getISOFormattedTime

public static java.lang.String getISOFormattedTime(java.util.Date date)
returns the date calendar in ISO format

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

getISOFormattedTime

public static java.lang.String getISOFormattedTime(java.util.Date date,
                                                   java.util.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 java.lang.String getISOFormattedTime(java.util.Calendar cal)
Parameters:
cal - a Calendar to get the timevalues of
Returns:
the passed calendar in ISO format

createCalendar

public static java.util.GregorianCalendar createCalendar(java.lang.String isoDate)
                                                  throws java.lang.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:
java.lang.NumberFormatException - if the parsted values of the given String are no proper numbers.

createDate

public static java.util.Date createDate(java.lang.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:
java.lang.NumberFormatException - if the parsted values of the given String are no proper numbers.

deegree 2.5 (2011/06/29 09:44 build-8-official)

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