public class CalendarFactory extends Object
Calendar
instances and keeping a central
TimeZone
.
The default is the system's local time zone. To change to a different time zone, invoke
CalendarFactory.getInstance().setTimeZone(tz)
. Instances are thread local, so
different threads may have different time zone settings.
Modifier and Type | Field and Description |
---|---|
static int |
EPOCH_YEAR
Epoch of PalmOS starts on January 1st, 1904.
|
Constructor and Description |
---|
CalendarFactory() |
Modifier and Type | Method and Description |
---|---|
Calendar |
create()
Creates a new
Calendar instance with the current time zone. |
Calendar |
createPalmEpoch()
Creates a
Calendar that is set to the PalmOS epoch. |
Calendar |
createWithTimeZone(TimeZone tz)
Creates a new
Calendar instance with the given time zone. |
static CalendarFactory |
getInstance()
Gets the singleton instance of the factory.
|
TimeZone |
getTimeZone() |
void |
setTimeZone(TimeZone timeZone)
The
TimeZone to be used. |
public static final int EPOCH_YEAR
public CalendarFactory()
public static CalendarFactory getInstance()
CalendarFactory
instancepublic void setTimeZone(TimeZone timeZone)
TimeZone
to be used. Defaults to the system's time zone.public TimeZone getTimeZone()
public Calendar create()
Calendar
instance with the current time zone.Calendar
public Calendar createWithTimeZone(TimeZone tz)
Calendar
instance with the given time zone.public Calendar createPalmEpoch()
Calendar
that is set to the PalmOS epoch.Calendar
set to the PalmOS epoch.Copyright © 2009–2017. All rights reserved.