public enum Time extends Enum<Time> implements org.joda.time.DateTimeUtils.MillisProvider
Use the methods on this class where you would have otherwise used System.currentTimeMillis(),
new Date(), Calendar.getInstance() or the various constructors and now methods
in org.joda.time.DateTime.
| Enum Constant and Description |
|---|
INSTANCE
Singleton Instance.
|
| Modifier and Type | Method and Description |
|---|---|
static long |
currentTimeMillis()
Get the current time in milliseconds from the
TimeService - this replaces
System.currentTimeMillis(). |
static Calendar |
getCalendarInstance()
Get a
Calendar with current time in milliseconds from the TimeService - this replaces
Calendar.getInstance(). |
static Calendar |
getCalendarInstance(Locale locale)
Get a
Calendar with current time in milliseconds from the TimeService - this replaces
Calendar.getInstance(Locale). |
static Calendar |
getCalendarInstance(TimeZone tz)
Get a
Calendar with current time in milliseconds from the TimeService - this replaces
Calendar.getInstance(TimeZone). |
static Calendar |
getCalendarInstance(TimeZone tz,
Locale locale)
Get a
Calendar with current time in milliseconds from the TimeService - this replaces
Calendar.getInstance(TimeZone, Locale). |
long |
getMillis() |
static Date |
newDate()
Get a
Date with current time in milliseconds from the TimeService - this replaces
new Date(). |
static Date |
newDate(long time)
Get a
Date with the specified time in milliseconds - this replaces new Date(long). |
static Time |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Time[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Time INSTANCE
public static Time[] values()
for (Time c : Time.values()) System.out.println(c);
public static Time valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic long getMillis()
getMillis in interface org.joda.time.DateTimeUtils.MillisProviderpublic static long currentTimeMillis()
TimeService - this replaces
System.currentTimeMillis().System.currentTimeMillis()public static Date newDate()
Date with current time in milliseconds from the TimeService - this replaces
new Date().Date()public static Date newDate(long time)
Date with the specified time in milliseconds - this replaces new Date(long).time - The time in milliseconds.Date()public static Calendar getCalendarInstance()
Calendar with current time in milliseconds from the TimeService - this replaces
Calendar.getInstance().Calendar.getInstance()public static Calendar getCalendarInstance(Locale locale)
Calendar with current time in milliseconds from the TimeService - this replaces
Calendar.getInstance(Locale).locale - The locale to use for the calendar instance.Calendar.getInstance(Locale)public static Calendar getCalendarInstance(TimeZone tz)
Calendar with current time in milliseconds from the TimeService - this replaces
Calendar.getInstance(TimeZone).tz - The timezone to use for the calendar instance.Calendar.getInstance(TimeZone)public static Calendar getCalendarInstance(TimeZone tz, Locale locale)
Calendar with current time in milliseconds from the TimeService - this replaces
Calendar.getInstance(TimeZone, Locale).tz - The timezone to use for the calendar instance.locale - The locale to use for the calendar instance.Calendar.getInstance(TimeZone, Locale)Copyright © 2010–2023 Open Identity Platform Community. All rights reserved.