Class SystemTime
java.lang.Object
org.broadleafcommerce.common.time.SystemTime
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Calendarstatic CalendarasCalendar(boolean includeTime) static CalendarasCalendar(Locale locale) static CalendarasCalendar(Locale locale, TimeZone timeZone, boolean includeTime) static CalendarasCalendar(TimeZone timeZone) static DateasDate()static DateasDate(boolean includeTime) static longasMillis()static longasMillis(boolean includeTime) static DategetCurrentDateWithinTimeResolution(Date cachedDate, Long dateResolutionMillis) Many DAO objects in Broadleaf use a cached time concept.static TimeSourcestatic voidreset()static voidstatic voidstatic voidsetGlobalTimeSource(TimeSource globalTS) static voidsetLocalTimeSource(TimeSource localTS) static booleanReturns false if the current time source is aFixedTimeSourceindicating that the time is being overridden.
-
Constructor Details
-
SystemTime
public SystemTime()
-
-
Method Details
-
getTimeSource
-
setGlobalTimeSource
-
resetGlobalTimeSource
public static void resetGlobalTimeSource() -
setLocalTimeSource
-
resetLocalTimeSource
public static void resetLocalTimeSource() -
reset
public static void reset() -
asMillis
public static long asMillis() -
asMillis
public static long asMillis(boolean includeTime) -
asDate
-
asDate
-
asCalendar
-
asCalendar
-
asCalendar
-
asCalendar
-
shouldCacheDate
public static boolean shouldCacheDate()Returns false if the current time source is aFixedTimeSourceindicating that the time is being overridden. For example to preview items in a later time.- Returns:
-
getCurrentDateWithinTimeResolution
Many DAO objects in Broadleaf use a cached time concept. Since most entities have an active start and end date, the DAO may ask for a representation of "NOW" that is within some threshold.By default, most entities cache active-date queries to every 10 seconds. These DAO classes can be overridden to extend or decrease this default.
- Returns:
-
asCalendar
-