public class SFDate extends SFInstant implements Comparable<SFDate>
| Modifier and Type | Field and Description |
|---|---|
static SFDate |
MAX_VALID_VALUE |
static SFDate |
MIN_VALID_VALUE |
DAY_OF_WEEK_ISO, GMT, POWERS_OF_TEN, WEEK_ISO, YEAR_OF_WEEK, YEAR_OF_WEEK_ISO| Constructor and Description |
|---|
SFDate(Date date)
Constructor using Java Date
|
SFDate(long millis)
Constructor using UTC milliseconds
|
SFDate(SFDate sfd)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
SFDate |
addDays(int ndays)
Increment current date by specified number of days
and return a new SFDate object.
|
int |
compareTo(SFDate other)
Compare if we're smaller than, equal to, or larger than the other SFDate
|
boolean |
equals(Object o) |
boolean |
equals(SFDate other)
Returns if we're equal to the other SFDate
|
int |
extract(int field,
Integer optWeekStart,
Integer optWoyPolicy)
Extract a particular component of a date.
|
static SFDate |
fromTimestamp(SFTimestamp timestamp)
Utility function generating a new SFDate from a given SFTimestamp.
|
Date |
getDate()
Return the embedded Java date object
|
long |
getTime()
Return the number of milliseconds since UTC epoch
|
int |
hashCode() |
String |
toString() |
String |
toUTCString()
Construct a string that can be safely passed to XP.
|
public static final SFDate MIN_VALID_VALUE
public static final SFDate MAX_VALID_VALUE
public SFDate(long millis)
millis - epoch time in UTC in millisecondspublic SFDate(Date date)
date - date instancepublic SFDate(SFDate sfd)
original is needed, use of this
constructor is unnecessary since SFDates are immutable.sfd - SFDate instancepublic Date getDate()
public long getTime()
public String toUTCString()
public int compareTo(SFDate other)
compareTo in interface Comparable<SFDate>other - target SFDatepublic boolean equals(SFDate other)
other - target SFDatepublic static SFDate fromTimestamp(SFTimestamp timestamp)
timestamp - source timestamppublic int extract(int field,
Integer optWeekStart,
Integer optWoyPolicy)
public SFDate addDays(int ndays)
ndays - Copyright © 2020. All rights reserved.