com.atlassian.bamboo.util
Class BambooDateUtils

java.lang.Object
  extended by com.atlassian.bamboo.util.BambooDateUtils

public class BambooDateUtils
extends java.lang.Object


Method Summary
static java.lang.String dateToPortableString(java.util.Date date)
           
static java.util.Date fromIsoTimestampString(java.lang.String dateString)
           
static long getMillisDistanceToNow(java.util.Date dateToCompare)
           
static int getMinutesDistanceToNow(java.util.Date dateToCompare)
           
static long getSecondsDistanceToNow(java.util.Date dateToCompare)
           
static boolean isWithinDays(java.util.Date earlierDate, java.util.Date laterDate, long days)
          Returns whether the laterDate is not later than the number of "days" since the last earlierDate
static boolean isWithinMillis(java.util.Date date1, java.util.Date date2, long millis)
          Returns true if the two given dates are within the given number of millis.
static java.util.Date portableDateToString(java.lang.String dateString)
           
static java.lang.String toIsoTimestampString(java.util.Date date)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isWithinDays

public static boolean isWithinDays(java.util.Date earlierDate,
                                   java.util.Date laterDate,
                                   long days)
Returns whether the laterDate is not later than the number of "days" since the last earlierDate

Parameters:
earlierDate - - must not be null
laterDate - - must not be null
days - - must be a positive integer
Returns:
true if within the number days specified

isWithinMillis

public static boolean isWithinMillis(@Nullable
                                     java.util.Date date1,
                                     @Nullable
                                     java.util.Date date2,
                                     long millis)
Returns true if the two given dates are within the given number of millis. If either of the passed dates is null then it returns false;

Parameters:
date1 - - must not be null
date2 - - must not be null
millis - - must be a positive long
Returns:
true if dates are within the given number millis

dateToPortableString

public static java.lang.String dateToPortableString(java.util.Date date)

portableDateToString

public static java.util.Date portableDateToString(java.lang.String dateString)
                                           throws java.text.ParseException
Throws:
java.text.ParseException

getMinutesDistanceToNow

public static int getMinutesDistanceToNow(java.util.Date dateToCompare)

getSecondsDistanceToNow

public static long getSecondsDistanceToNow(java.util.Date dateToCompare)

getMillisDistanceToNow

public static long getMillisDistanceToNow(java.util.Date dateToCompare)

toIsoTimestampString

@NotNull
public static java.lang.String toIsoTimestampString(@NotNull
                                                            java.util.Date date)

fromIsoTimestampString

@NotNull
public static java.util.Date fromIsoTimestampString(@NotNull
                                                            java.lang.String dateString)


Copyright © 2010 Atlassian. All Rights Reserved.