org.ow2.wildcat.util
Class TimeUtil

java.lang.Object
  extended by org.ow2.wildcat.util.TimeUtil

public class TimeUtil
extends Object

Date and Time helper class.


Constructor Summary
TimeUtil()
           
 
Method Summary
static String format(long timeStamp)
          Format a timestamp into a human readable String.
static long now()
          Get current time timestamp.
static long parse(String date)
          Compute a timestamp from a human readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeUtil

public TimeUtil()
Method Detail

format

public static String format(long timeStamp)
Format a timestamp into a human readable String.

Parameters:
timeStamp - a timestamp
Returns:
a String representation of the timestamp according to FORMAT

parse

public static long parse(String date)
                  throws ParseException
Compute a timestamp from a human readable String.

Parameters:
date - a Date and Time in a String representation
Returns:
a timestamp
Throws:
ParseException - if date can't be parsed according to FORMAT

now

public static long now()
Get current time timestamp.

Returns:
current timestamp


Copyright © 2010 OW2 Consortium. All Rights Reserved.