sk.baka.tools
Class DateUtils

java.lang.Object
  extended by sk.baka.tools.DateUtils

public final class DateUtils
extends Object

Contains utility methods for work with the Date class.

Author:
Martin Vysny

Field Summary
static long MILLIS_IN_DAY
          Number of milliseconds in a day.
 
Method Summary
static void setZeroTime(Calendar cal)
          Clears the time part of given calendar.
static Date withZeroTime(Date date)
          Returns a new date with zeroed time part.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MILLIS_IN_DAY

public static final long MILLIS_IN_DAY
Number of milliseconds in a day.

See Also:
Constant Field Values
Method Detail

setZeroTime

public static void setZeroTime(Calendar cal)
Clears the time part of given calendar. This is guaranteed to work correctly with JPA TemporalType.DATE type.

Parameters:
cal - the calendar.

withZeroTime

public static Date withZeroTime(Date date)
Returns a new date with zeroed time part. This is guaranteed to work correctly with JPA TemporalType.DATE type.

Parameters:
date - the date, will not be modified. Must not be null.
Returns:
a new date with zeroed time part, never null


Copyright © 2009-2010. All Rights Reserved.