public class FunctionsMySQL extends Object
Constructor and Description |
---|
FunctionsMySQL() |
Modifier and Type | Method and Description |
---|---|
static String |
date(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 String |
fromUnixTime(int seconds)
See
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_from-unixtime
|
static String |
fromUnixTime(int seconds,
String format)
See
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_from-unixtime
|
static void |
register(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(Timestamp timestamp)
Get the seconds since 1970-01-01 00:00:00 UTC of the given timestamp.
|
public static void register(Connection conn) throws SQLException
conn
- the connectionSQLException
public static int unixTimestamp()
public static int unixTimestamp(Timestamp timestamp)
timestamp
- the timestamppublic static String fromUnixTime(int seconds)
seconds
- The current timestamp in seconds.public static String fromUnixTime(int seconds, String format)
seconds
- The current timestamp in seconds.format
- The format of the date/time String to return.public static String date(String dateTime)
dateTime
- The date/time String from which to extract just the date
part.Copyright © 2020 JBoss by Red Hat. All rights reserved.