com.atlassian.bamboo.util
Class BambooDateUtils
java.lang.Object
com.atlassian.bamboo.util.BambooDateUtils
public class BambooDateUtils
- extends java.lang.Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 nulllaterDate
- - must not be nulldays
- - 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 nulldate2
- - must not be nullmillis
- - 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 long getMinutesDistanceToNow(@NotNull
java.util.Date dateToCompare)
getSecondsDistanceToNow
public static long getSecondsDistanceToNow(@NotNull
java.util.Date dateToCompare)
getMillisDistanceToNow
public static long getMillisDistanceToNow(@NotNull
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 © 2011 Atlassian. All Rights Reserved.