public class SystemTime extends Object
Constructor and Description |
---|
SystemTime() |
Modifier and Type | Method and Description |
---|---|
static Calendar |
asCalendar() |
static Calendar |
asCalendar(boolean includeTime) |
static Calendar |
asCalendar(Locale locale) |
static Calendar |
asCalendar(Locale locale,
TimeZone timeZone,
boolean includeTime) |
static Calendar |
asCalendar(TimeZone timeZone) |
static Date |
asDate() |
static Date |
asDate(boolean includeTime) |
static long |
asMillis() |
static long |
asMillis(boolean includeTime) |
static Date |
getCurrentDateWithinTimeResolution(Date cachedDate,
Long dateResolutionMillis)
Many DAO objects in Broadleaf use a cached time concept.
|
static TimeSource |
getTimeSource() |
static void |
reset() |
static void |
resetGlobalTimeSource() |
static void |
resetLocalTimeSource() |
static void |
setGlobalTimeSource(TimeSource globalTS) |
static void |
setLocalTimeSource(TimeSource localTS) |
static boolean |
shouldCacheDate()
Returns false if the current time source is a
FixedTimeSource indicating that the
time is being overridden. |
public static TimeSource getTimeSource()
public static void setGlobalTimeSource(TimeSource globalTS)
public static void resetGlobalTimeSource()
public static void setLocalTimeSource(TimeSource localTS)
public static void resetLocalTimeSource()
public static void reset()
public static long asMillis()
public static long asMillis(boolean includeTime)
public static Date asDate()
public static Date asDate(boolean includeTime)
public static Calendar asCalendar()
public static Calendar asCalendar(boolean includeTime)
public static boolean shouldCacheDate()
FixedTimeSource
indicating that the
time is being overridden. For example to preview items in a later time.public static Date getCurrentDateWithinTimeResolution(Date cachedDate, Long dateResolutionMillis)
Copyright © 2022. All rights reserved.