public class FunctionsMySQL
extends java.lang.Object
| Constructor and Description |
|---|
FunctionsMySQL() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
date(java.lang.String dateTime)
See
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date
This function is dependent on the exact formatting of the MySQL date/time
string.
|
static java.lang.String |
fromUnixTime(int seconds)
See
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_from-unixtime
|
static java.lang.String |
fromUnixTime(int seconds,
java.lang.String format)
See
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_from-unixtime
|
static void |
register(java.sql.Connection conn)
Register the functionality in the database.
|
static int |
unixTimestamp()
Get the seconds since 1970-01-01 00:00:00 UTC.
|
static int |
unixTimestamp(java.sql.Timestamp timestamp)
Get the seconds since 1970-01-01 00:00:00 UTC of the given timestamp.
|
public static void register(java.sql.Connection conn)
throws java.sql.SQLException
conn - the connectionjava.sql.SQLExceptionpublic static int unixTimestamp()
public static int unixTimestamp(java.sql.Timestamp timestamp)
timestamp - the timestamppublic static java.lang.String fromUnixTime(int seconds)
seconds - The current timestamp in seconds.public static java.lang.String fromUnixTime(int seconds,
java.lang.String format)
seconds - The current timestamp in seconds.format - The format of the date/time String to return.public static java.lang.String date(java.lang.String dateTime)
dateTime - The date/time String from which to extract just the date
part.