public class DateTime extends Object
java.sql.Date.valueOf(), java.sql.Time.valueOf() or java.sql.Timestamp.valueOf().
| Modifier and Type | Method and Description |
|---|---|
static Date |
dateBytesToDate(byte[] buffer,
int offset,
Calendar recyclableCal,
String encoding)
Expected character representation is DERBY string representation of a date,
which is in JIS format:
yyyy-mm-dd |
static Timestamp |
dateBytesToTimestamp(byte[] buffer,
int offset,
Calendar recyclableCal,
String encoding)
Expected character representation is DERBY string representation of a date
which is in JIS format:
yyyy-mm-dd |
static int |
dateToDateBytes(byte[] buffer,
int offset,
Date date,
Calendar cal)
Date is converted to a char representation in JDBC date format:
yyyy-mm-dd date format
and then converted to bytes using UTF8 encoding |
static int |
dateToTimestampBytes(byte[] buffer,
int offset,
Date date,
Calendar cal)
java.sql.Date is converted to character representation that is in DERBY string
representation of a timestamp:
yyyy-mm-dd-hh.mm.ss.ffffff and then
converted to bytes using UTF8 encoding and written out to the buffer |
static Time |
timeBytesToTime(byte[] buffer,
int offset,
Calendar recyclableCal,
String encoding)
Expected character representation is DERBY string representation of time,
which is in the format:
hh.mm.ss |
static Timestamp |
timeBytesToTimestamp(byte[] buffer,
int offset,
Calendar recyclableCal,
String encoding)
Expected character representation is DERBY string representation of time
which is in the format:
hh.mm.ss |
static Date |
timestampBytesToDate(byte[] buffer,
int offset,
Calendar recyclableCal,
String encoding)
Expected character representation is DERBY string representation of a timestamp:
yyyy-mm-dd-hh.mm.ss.ffffff. |
static Time |
timestampBytesToTime(byte[] buffer,
int offset,
Calendar recyclableCal,
String encoding)
Expected character representation is DERBY string representation of a timestamp:
yyyy-mm-dd-hh.mm.ss.ffffff. |
static Timestamp |
timestampBytesToTimestamp(byte[] buffer,
int offset,
Calendar recyclableCal,
String encoding)
Expected character representation is DERBY string representation of a timestamp:
yyyy-mm-dd-hh.mm.ss.ffffff. |
static int |
timestampToDateBytes(byte[] buffer,
int offset,
Timestamp timestamp,
Calendar cal)
java.sql.Timestamp is converted to character representation that is in JDBC date escape
format:
yyyy-mm-dd, which is the same as JIS date format in DERBY string representation of a date. |
static int |
timestampToTimeBytes(byte[] buffer,
int offset,
Timestamp timestamp,
Calendar cal)
java.sql.Timestamp is converted to character representation in JDBC time escape format:
hh:mm:ss, which is the same as
JIS time format in DERBY string representation of a time. |
static int |
timestampToTimestampBytes(byte[] buffer,
int offset,
Timestamp timestamp,
Calendar cal)
java.sql.Timestamp is converted to a character representation which is in DERBY string
representation of a timestamp:
yyyy-mm-dd-hh.mm.ss.ffffff. |
static int |
timeToTimeBytes(byte[] buffer,
int offset,
Time time,
Calendar cal)
java.sql.Time is converted to character representation which is in JDBC time escape
format:
hh:mm:ss, which is the same as JIS time format in DERBY string
representation of a time. |
static int |
timeToTimestampBytes(byte[] buffer,
int offset,
Time time,
Calendar cal)
java.sql.Time is converted to a character representation that is in DERBY string representation of a timestamp:
yyyy-mm-dd-hh.mm.ss.ffffff and converted to bytes using UTF8 encoding |
public static final Date dateBytesToDate(byte[] buffer, int offset, Calendar recyclableCal, String encoding) throws UnsupportedEncodingException
yyyy-mm-dd buffer - offset - recyclableCal - encoding - encoding of buffer dataUnsupportedEncodingExceptionpublic static final Time timeBytesToTime(byte[] buffer, int offset, Calendar recyclableCal, String encoding) throws UnsupportedEncodingException
hh.mm.ss buffer - offset - recyclableCal - encoding - encoding of bufferUnsupportedEncodingExceptionpublic static final Timestamp timestampBytesToTimestamp(byte[] buffer, int offset, Calendar recyclableCal, String encoding) throws UnsupportedEncodingException
yyyy-mm-dd-hh.mm.ss.ffffff.buffer - offset - recyclableCal - encoding - encoding of bufferUnsupportedEncodingExceptionpublic static final int dateToDateBytes(byte[] buffer,
int offset,
Date date,
Calendar cal)
throws SqlException,
UnsupportedEncodingException
yyyy-mm-dd date format
and then converted to bytes using UTF8 encodingbuffer - bytes in UTF8 encoding of the dateoffset - write into the buffer from this offsetdate - date valueSqlExceptionUnsupportedEncodingException - if UTF8 Encoding is not supportedpublic static final int timeToTimeBytes(byte[] buffer,
int offset,
Time time,
Calendar cal)
throws UnsupportedEncodingException
hh:mm:ss, which is the same as JIS time format in DERBY string
representation of a time. The char representation is converted to bytes using UTF8
encoding.buffer - bytes in UTF8 encoding of the timeoffset - write into the buffer from this offsettime - java.sql.Time valueUnsupportedEncodingExceptionpublic static final int timestampToTimestampBytes(byte[] buffer,
int offset,
Timestamp timestamp,
Calendar cal)
throws SqlException,
UnsupportedEncodingException
yyyy-mm-dd-hh.mm.ss.ffffff.
and then converted to bytes using UTF8 encodingbuffer - bytes in UTF8 encoding of the timestampoffset - write into the buffer from this offsettimestamp - timestamp valueSqlExceptionUnsupportedEncodingExceptionpublic static final Timestamp dateBytesToTimestamp(byte[] buffer, int offset, Calendar recyclableCal, String encoding) throws UnsupportedEncodingException
yyyy-mm-dd buffer - offset - recyclableCal - encoding - encoding of bufferUnsupportedEncodingExceptionpublic static final Timestamp timeBytesToTimestamp(byte[] buffer, int offset, Calendar recyclableCal, String encoding) throws UnsupportedEncodingException
hh.mm.ss buffer - offset - recyclableCal - encoding - encoding of bufferUnsupportedEncodingExceptionpublic static final Date timestampBytesToDate(byte[] buffer, int offset, Calendar recyclableCal, String encoding) throws UnsupportedEncodingException
yyyy-mm-dd-hh.mm.ss.ffffff.buffer - offset - recyclableCal - encoding - encoding of bufferUnsupportedEncodingExceptionpublic static final Time timestampBytesToTime(byte[] buffer, int offset, Calendar recyclableCal, String encoding) throws UnsupportedEncodingException
yyyy-mm-dd-hh.mm.ss.ffffff.buffer - offset - recyclableCal - encoding - encoding of bufferUnsupportedEncodingExceptionpublic static final int timestampToDateBytes(byte[] buffer,
int offset,
Timestamp timestamp,
Calendar cal)
throws SqlException,
UnsupportedEncodingException
yyyy-mm-dd, which is the same as JIS date format in DERBY string representation of a date.
and then converted to bytes using UTF8 encoding.buffer - offset - write into the buffer from this offsettimestamp - timestamp valueSqlExceptionUnsupportedEncodingExceptionpublic static final int timestampToTimeBytes(byte[] buffer,
int offset,
Timestamp timestamp,
Calendar cal)
throws UnsupportedEncodingException
hh:mm:ss, which is the same as
JIS time format in DERBY string representation of a time. The char representation is
then converted to bytes using UTF8 encoding and written out into the bufferbuffer - offset - write into the buffer from this offsettimestamp - timestamp valueUnsupportedEncodingExceptionpublic static final int dateToTimestampBytes(byte[] buffer,
int offset,
Date date,
Calendar cal)
throws SqlException,
UnsupportedEncodingException
yyyy-mm-dd-hh.mm.ss.ffffff and then
converted to bytes using UTF8 encoding and written out to the bufferbuffer - offset - offset in buffer to start writing todate - date valueSqlExceptionUnsupportedEncodingExceptionpublic static final int timeToTimestampBytes(byte[] buffer,
int offset,
Time time,
Calendar cal)
throws UnsupportedEncodingException
yyyy-mm-dd-hh.mm.ss.ffffff and converted to bytes using UTF8 encodingbuffer - offset - offset in buffer to start writing totime - time valueUnsupportedEncodingExceptionCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.