public class SQLDate
extends java.lang.Object
| Constructor and Description |
|---|
SQLDate() |
| Modifier and Type | Method and Description |
|---|---|
static java.sql.Date |
dateFromDateString(java.lang.String dateString)
Creates a Date instance for the specified ISO 8601 date.
|
static java.sql.Date |
dateFromDateTimeString(java.lang.String datetimeString)
Creates a Date instance for the specified ISO 8601 date and time.
|
static java.sql.Date |
dateFromTimeString(java.lang.String timeString)
Creates a Date instance for the specified ISO 8601 time.
|
static java.sql.Timestamp |
timestampFromDateTimeString(java.lang.String datetimeString)
Creates a Timestamp instance for the specified extended ISO 8601 date and time.
|
static java.lang.String |
toDateString(java.sql.Date date)
Return the ISO 8601 representation of the specified Date.
|
static java.lang.String |
toDateTimeString(java.sql.Date date)
Return the ISO 8601 representation of the specified Date.
|
static java.lang.String |
toDateTimeString(java.sql.Timestamp ts)
Return the ISO 8601 representation of the specified date and time.
|
static java.lang.String |
toTimeString(java.sql.Date date)
Return the ISO 8601 representation of the specified Date.
|
public static java.sql.Date dateFromDateString(java.lang.String dateString)
throws java.lang.IllegalArgumentException
dateString - the ISO 8601 representation of a date.java.lang.IllegalArgumentException - if an error occurs parsing the date string.
public static java.sql.Date dateFromTimeString(java.lang.String timeString)
throws java.lang.IllegalArgumentException
timeString - the ISO 8601 representation of a point in time.java.lang.IllegalArgumentException - if an error occurs parsing the date string.
public static java.sql.Date dateFromDateTimeString(java.lang.String datetimeString)
throws java.lang.IllegalArgumentException
datetimeString - the ISO 8601 representation of a date and time.java.lang.IllegalArgumentException - if an error occurs parsing the date string.public static java.lang.String toTimeString(java.sql.Date date)
date - the date/time to format.public static java.lang.String toDateString(java.sql.Date date)
date - the date/time to format.public static java.lang.String toDateTimeString(java.sql.Date date)
date - the date/time to format.
public static java.sql.Timestamp timestampFromDateTimeString(java.lang.String datetimeString)
throws java.lang.IllegalArgumentException
datetimeString - the extended ISO 8601 representation of a date and time.java.lang.IllegalArgumentException - if an error occurs parsing the date string.public static java.lang.String toDateTimeString(java.sql.Timestamp ts)
ts - the timestamp to format.