public class ZonelessTimestamp extends ZonelessDatetime
| Modifier and Type | Field and Description |
|---|---|
protected int |
precision |
protected Timestamp |
tempTimestamp |
internalTime, lastFormat, tempCal, tempFormatter| Constructor and Description |
|---|
ZonelessTimestamp()
Constructs a ZonelessTimestamp.
|
ZonelessTimestamp(int precision)
Constructs a ZonelessTimestamp with precision.
|
| Modifier and Type | Method and Description |
|---|---|
protected Timestamp |
getTempTimestamp(long value)
Gets a temporary Timestamp object.
|
static ZonelessTimestamp |
parse(String s)
Parses a string as a ZonelessTimestamp.
|
static ZonelessTimestamp |
parse(String s,
String format)
Parses a string as a ZonelessTimestamp using a given format string.
|
Object |
toJdbcObject()
Returns this datetime as a Jdbc object
|
String |
toString()
Converts this ZonelessTimestamp to a java.sql.Timestamp and formats it
via the
toString() method of that
class. |
String |
toString(String format)
Formats this ZonelessTimestamp via a SimpleDateFormat.
|
clearDate, clearTime, getCalendar, getDateValue, getFormatter, getJdbcDate, getJdbcTime, getJdbcTimestamp, getTime, getTimeValue, setZonedTime, setZonelessTimeprotected final int precision
protected transient Timestamp tempTimestamp
public ZonelessTimestamp()
public ZonelessTimestamp(int precision)
The precision is the number of digits to the right of the decimal
point in the seconds value. For example, a TIMESTAMP(3) has
a precision to milliseconds.
precision - Number of digits of precisionpublic Object toJdbcObject()
ZonelessDatetimetoJdbcObject in class ZonelessDatetimepublic String toString()
toString() method of that
class.
Note: Jdbc formatting always includes a decimal point and at least one digit of milliseconds precision. Trailing zeros, except for the first one after the decimal point, do not appear in the output.
public String toString(String format)
format - format string, as required by SimpleDateFormatpublic static ZonelessTimestamp parse(String s)
This method's parsing is strict and may parse fractional seconds (as opposed to just milliseconds.)
s - a string representing a time in ISO format, i.e. according to
the SimpleDateFormat string "yyyy-MM-dd HH:mm:ss"public static ZonelessTimestamp parse(String s, String format)
This method's parsing is strict and may parse fractional seconds (as opposed to just milliseconds.)
s - a string representing a time in ISO format, i.e. according to
the SimpleDateFormat string "yyyy-MM-dd HH:mm:ss"format - Format string as per SimpleDateFormatprotected Timestamp getTempTimestamp(long value)
Copyright © 2012–2015 The Apache Software Foundation. All rights reserved.