public class Timestamp extends Object
| Constructor and Description |
|---|
Timestamp()
Constructor
|
Timestamp(Date date)
Construct and initialize structure from an Date
|
Timestamp(int sse)
Construct and initialize structure from an integer number of seconds
since the epoch.
|
Timestamp(String dateStr)
Construct and initialize structure from a 14-digit String timestamp.
|
| Modifier and Type | Method and Description |
|---|---|
int |
absDistanceFromTimestamp(Timestamp otherTimeStamp)
function that calculates integer seconds between this records
timeStamp and the arguments timeStamp.
|
static Timestamp |
currentTimestamp() |
static Calendar |
dateStrToCalendar(String dateStr) |
static Date |
dateStrToDate(String dateStr)
cleanup the dateStr argument assuming earliest values, and return a
GMT calendar set to the time described by the dateStr.
|
int |
distanceFromTimestamp(Timestamp otherTimeStamp)
function that calculates integer seconds between this records
timeStamp and the arguments timeStamp.
|
static Timestamp |
earliestTimestamp() |
static Timestamp |
fromSse(int sse) |
Date |
getDate() |
String |
getDateStr() |
String |
getDay() |
static int |
getEndYear() |
String |
getMonth() |
static int |
getStartYear() |
String |
getYear() |
static Timestamp |
latestTimestamp() |
static String |
padEndDateStr(String timestamp)
clean up timestamp argument assuming latest possible values for missing
or bogus digits.
|
static String |
padStartDateStr(String timestamp)
clean up timestamp argument assuming earliest possible values for missing
or bogus digits.
|
static Timestamp |
parseAfter(String dateStr) |
static Timestamp |
parseBefore(String dateStr) |
String |
prettyDate() |
String |
prettyDateTime() |
String |
prettyTime() |
void |
setDate(Date date)
set internal structure using Date argument
|
void |
setDateStr(String dateStr)
initialize interal data structures for this Timestamp from the 14-digit
argument.
|
void |
setSse(int sse)
set internal structure using seconds since the epoch integer argument
|
void |
setStartYear(int year)
Set the mimimum year for the service.
|
int |
sse() |
public Timestamp()
public Timestamp(String dateStr)
dateStr - from which to set datepublic Timestamp(int sse)
sse - SecondsSinceEpochpublic Timestamp(Date date)
date - from which date should be setpublic final void setDate(Date date)
date - from which date should be setpublic Date getDate()
public final void setSse(int sse)
sse - SecondsSinceEpochpublic void setDateStr(String dateStr)
dateStr - containing the timestamppublic String getDateStr()
public int sse()
public int absDistanceFromTimestamp(Timestamp otherTimeStamp)
otherTimeStamp - to comparepublic int distanceFromTimestamp(Timestamp otherTimeStamp)
otherTimeStamp - to comparepublic String getYear()
public String getMonth()
public String getDay()
public String prettyDate()
public String prettyTime()
public String prettyDateTime()
public static Calendar dateStrToCalendar(String dateStr)
dateStr - up to 14 digit String representing datepublic static Date dateStrToDate(String dateStr)
dateStr - from which to create Calendarpublic static String padEndDateStr(String timestamp)
timestamp - Stringpublic static String padStartDateStr(String timestamp)
timestamp - Stringpublic static Timestamp parseBefore(String dateStr)
dateStr - containing timestamppublic static Timestamp parseAfter(String dateStr)
dateStr - containing timestamppublic static Timestamp fromSse(int sse)
sse - SecondsSinceEpochpublic static Timestamp currentTimestamp()
public static Timestamp latestTimestamp()
public static Timestamp earliestTimestamp()
public void setStartYear(int year)
year - The four digit year to set the lower limit of years handled by the server.public static int getStartYear()
public static int getEndYear()
Copyright © 2005–2019 IIPC. All rights reserved.