public class TmExt extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TmExt.YearDay |
| Modifier and Type | Field and Description |
|---|---|
static int |
DAYS_IN_WEEK |
static long |
EPOCH_AUTO_LIMIT |
static long |
EPOCH_END |
static long |
EPOCH_START |
static int |
FRAC_SECONDS |
static int |
HOURS_IN_DAY |
static int |
MAX_DAYS_IN_MONTH |
static int |
MAX_DAYS_IN_YEAR |
static int |
MAX_REGION_LEN |
static int |
MAX_SCALE |
static int |
MAX_YEAR |
static int |
MAX_ZONE_LEN |
static int |
MINUTES_IN_DAY |
static int |
MINUTES_IN_HOUR |
static int |
MONTHS_IN_YEAR |
TimeZone |
s_gmtTz |
static int |
SECONDS_IN_DAY |
static int |
SECONDS_IN_HOUR |
static int |
SECONDS_IN_MINUTE |
long |
tm_epochSec |
int |
tm_gmtoff |
boolean |
tm_has_epochSec |
boolean |
tm_has_offset |
boolean |
tm_has_tzidx |
int |
tm_hour |
int |
tm_isdst |
int |
tm_mday |
int |
tm_min |
int |
tm_mon |
int |
tm_nsec |
String |
tm_region |
int |
tm_sec |
int |
tm_sec_scale |
int |
tm_wday |
int |
tm_yday |
int |
tm_year |
String |
tm_zone |
| Constructor and Description |
|---|
TmExt()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
static int |
dayOfWeek(int date)
Compute American-style (Sunday = 0) day of the week from
Unix epoch day (0 = Jan 1st 1970)
|
SFDate |
getDate()
Get SFDate from this structure
|
SFTime |
getTime()
Get time of day as SFTime
|
SFTimestamp |
getTimestamp(TimeZone tz)
Get timestamp as SFTimestamp
|
static boolean |
isGoodMonthDay(int month,
int mday,
boolean leap)
Check if the day of the month is good
|
static boolean |
isLeapYear(int year)
Check if it's a leap year in proleptic Gregorian calendar.
|
static int |
mdayFromYday(int yday,
int month,
boolean leap)
Returns day of the month by day of the year and month
|
static int |
monthFromYday(int yday,
boolean leap)
Returns month # based on day of the year
|
void |
setDate(SFDate d)
Set this structure from SFDate
NB: This relies on GeorgianCalendar, which is NOT
ISO-8601 compliant proleptic Georgian calendar
|
void |
setTime(SFTime t,
int scale)
Set this structure from SFTime
|
void |
setTimestamp(SFTimestamp ts,
int scale,
TimeZone tz)
Set this structure from SFTimestamp
NB: This relies on GeorgianCalendar, which is NOT
ISO-8601 compliant proleptic Georgian calendar
|
static int |
ydayFromMonthDay(int month,
int mday,
boolean leap) |
static TmExt.YearDay |
yearFromDate(int date)
Returns year based on Unix Epoch day (0 = Jan 1st, 1970)
in proleptic Gregorian calendar.
|
static int |
yearStartDate(int year)
Returns starting day of the year in Unix epoch (0= Jan 1st, 1970)
in proleptic Gregorian calendar.
|
public int tm_sec
public int tm_min
public int tm_hour
public int tm_mday
public int tm_mon
public int tm_year
public int tm_wday
public int tm_yday
public int tm_isdst
public int tm_gmtoff
public String tm_zone
public long tm_epochSec
public int tm_nsec
public int tm_sec_scale
public String tm_region
public boolean tm_has_offset
public boolean tm_has_epochSec
public boolean tm_has_tzidx
public static final int SECONDS_IN_MINUTE
public static final int MINUTES_IN_HOUR
public static final int SECONDS_IN_HOUR
public static final int HOURS_IN_DAY
public static final int MINUTES_IN_DAY
public static final int SECONDS_IN_DAY
public static final int DAYS_IN_WEEK
public static final int MONTHS_IN_YEAR
public static final int MAX_DAYS_IN_MONTH
public static final int MAX_DAYS_IN_YEAR
public static final int MAX_YEAR
public static final int MAX_SCALE
public static final int FRAC_SECONDS
public static final int MAX_ZONE_LEN
public static final int MAX_REGION_LEN
public static final long EPOCH_START
public static final long EPOCH_END
public static final long EPOCH_AUTO_LIMIT
public final TimeZone s_gmtTz
public static boolean isLeapYear(int year)
year - (0-based) to look atpublic static TmExt.YearDay yearFromDate(int date)
date - the epoch daypublic static int yearStartDate(int year)
year - zero-based year (0 = 1 BC)public static int monthFromYday(int yday,
boolean leap)
yday - day # in the year (staring from 0)leap - true for leap yearspublic static int mdayFromYday(int yday,
int month,
boolean leap)
yday - Day of the year (starting from 0)month - Month (0-11)leap - True for leap yearspublic static int dayOfWeek(int date)
date - Unix epoch daypublic static int ydayFromMonthDay(int month,
int mday,
boolean leap)
public static boolean isGoodMonthDay(int month,
int mday,
boolean leap)
month - month of the year (0-11)mday - day of the month (0-30)leap - true if this is a leap yearpublic void setTimestamp(SFTimestamp ts, int scale, TimeZone tz)
ts - the timestampscale - scale for fractional secondstz - timezone to display (null to use TZ name from SFTimestamp)public void setDate(SFDate d)
d - SFDatepublic SFDate getDate()
public void setTime(SFTime t, int scale)
t - SFTimescale - scalepublic SFTime getTime()
public SFTimestamp getTimestamp(TimeZone tz)
tz - the timezone to use by defaultCopyright © 2020. All rights reserved.