public class NSFDateTime extends Object implements Serializable, NSFTimeType, Comparable<NSFDateTime>
TIMEDATE
and does not
require a backing C struct.
This representation is immutable; all methods that alter or translate its values return a new object with the altered value.
Constructor and Description |
---|
NSFDateTime()
Constructs a new NSFDateTime based on the current time and time-zone settings, according tp
Calendar.getInstance() . |
NSFDateTime(Calendar cal) |
NSFDateTime(Date date) |
NSFDateTime(int year,
int month,
int day)
Constructs a date-only NSFDateTime value.
|
NSFDateTime(int hour,
int minute,
int second,
int hundredth)
Constructs a time-only NSFDateTime value.
|
NSFDateTime(TIME time) |
NSFDateTime(TIMEDATE timedate) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(NSFDateTime o) |
static NSFDateTime |
createDateOnly(int year,
int month,
int day)
Constructs a date-only NSFDateTime value.
|
static NSFDateTime |
createTimeOnly(int hour,
int minute,
int second,
int hundredth)
Constructs a time-only NSFDateTime value.
|
boolean |
equals(Object obj) |
static NSFDateTime |
fromTimeConstant(TimeConstant timeConstant)
Constructs an
NSFDateTime value corresponding to the provided TimeConstant . |
int |
getDay() |
int |
getHour() |
int |
getHundredth() |
int |
getInnards1() |
int |
getInnards2() |
int |
getMinute() |
int |
getMonth() |
int |
getSecond() |
int |
getYear() |
int |
getZone()
This method returns the time zone offset using Notes's notation.
|
int |
hashCode() |
boolean |
hasInnards()
Determines whether this object has valid "innards" values, which are
set when the object is created from a
TIMEDATE . |
boolean |
isAnyDate() |
boolean |
isAnyTime() |
boolean |
isDst() |
boolean |
isNullValue() |
static NSFDateTime |
now()
Constructs an
NSFDateTime value for the current time, according to the Domino API. |
Calendar |
toCalendar()
Returns this date/time value as a
Calendar . |
Date |
toDate() |
NSFDateTime |
toDateOnly() |
String |
toString() |
TIMEDATE |
toTIMEDATE()
Creates a
TIMEDATE struct representing the current value. |
NSFDateTime |
toTimeOnly() |
public NSFDateTime()
Calendar.getInstance()
.public NSFDateTime(Date date)
public NSFDateTime(Calendar cal)
public NSFDateTime(TIME time)
public NSFDateTime(TIMEDATE timedate) throws DominoException
DominoException
public NSFDateTime(int year, int month, int day)
year
- month
- day
- public NSFDateTime(int hour, int minute, int second, int hundredth)
hour
- minute
- second
- hundredth
- public static NSFDateTime createDateOnly(int year, int month, int day)
NSFDateTime(int, int, int)
, but may be preferred for readability.year
- month
- day
- public static NSFDateTime createTimeOnly(int hour, int minute, int second, int hundredth)
NSFDateTime(int, int, int, int)
, but may be preferred for readability.year
- month
- day
- public static NSFDateTime fromTimeConstant(TimeConstant timeConstant) throws DominoException
NSFDateTime
value corresponding to the provided TimeConstant
.timeConstant
- NSFDateTime
DominoException
- if there is a lower-level-API problem determining the date/timeIllegalArgumentException
- if timeConstant
is nullpublic static NSFDateTime now() throws DominoException
NSFDateTime
value for the current time, according to the Domino API.NSFDateTime
DominoException
- if there is a lower-level-API problem determining the date/timepublic int getYear()
public int getMonth()
public int getDay()
public int getHour()
public int getMinute()
public int getSecond()
public int getHundredth()
public int getZone()
public boolean isDst()
public Calendar toCalendar()
Calendar
. If the date/time expresses only date or time,
the other component is filled in with the epoch.public Date toDate()
public boolean isAnyTime()
public NSFDateTime toDateOnly()
public boolean isAnyDate()
public NSFDateTime toTimeOnly()
public TIMEDATE toTIMEDATE() throws DominoException
TIMEDATE
struct representing the current value. The caller is responsible
for freeing this struct.TIMEDATE
struct representing the current valueDominoException
- if there is a lower-level-API problem constructing the structpublic boolean isNullValue()
public boolean hasInnards()
TIMEDATE
.public int getInnards1()
-1
if this object
was not created from a TIMEDATE
public int getInnards2()
-1
if this object
was not created from a TIMEDATE
public int compareTo(NSFDateTime o)
compareTo
in interface Comparable<NSFDateTime>
Copyright © 2014–2018. All rights reserved.