In Oracle Database, the EXTRACT(datetime)
function extracts and returns the value of a specified datetime field from a datetime or interval expression.
Tag: date functions
Change the Time Zone Offset on a datetimeoffset Value in SQL Server (T-SQL)
You can use the SWITCHOFFSET()
function in SQL Server to change the time zone offset on a datetimeoffset value.
The function accepts two arguments; a datetimeoffset(n) value (or an expression that can be resolved to a datetimeoffset(n) value), and the new time zone.
Continue readingMariaDB Date & Time Functions (Full List)
This article contains a full list of built-in MariaDB date and time functions.
Continue readingHow SQRT() Works in MariaDB
In MariaDB, ASIN()
is a built-in numeric function that returns the square root of its argument.
How ADD_MONTHS() Works in MariaDB
In MariaDB, ADD_MONTHS()
is a built-in date and time function that adds a given number of months to a date, and returns the result.
The date can be a date, datetime, or timestamp value.
This function was introduced in MariaDB 10.6.1 to enhance Oracle compatibility. There are at least 6 other ways to add months to a date in MariaDB.
Continue readingHow UTC_TIMESTAMP() Works in MariaDB
In MariaDB, UTC_TIMESTAMP()
is a built-in date and time function that returns the current UTC date and time.
The result is returned in ‘YYYY-MM-DD HH:MM:SS’ or YYYYMMDDHHMMSS.uuuuuu format, depending on whether the function is used in a string or numeric context.
UTC stands for Coordinated Universal Time, and is the world standard for regulating time.
Continue readingHow UTC_TIME() Works in MariaDB
In MariaDB, UTC_TIME()
is a built-in date and time function that returns the current UTC time.
The result is returned in ‘HH:MM:SS’ or HHMMSS.uuuuuu format, depending on whether the function is used in a string or numeric context.
UTC stands for Coordinated Universal Time, and is the world standard for regulating time.
Continue readingHow UTC_DATE() Works in MariaDB
In MariaDB, UTC_DATE()
is a built-in date and time function that returns the current UTC date.
The result is returned in ‘YYYY-MM-DD’ or YYYYMMDD format, depending on whether the function is used in a string or numeric context.
UTC stands for Coordinated Universal Time, and is the world standard for regulating time.
Continue readingHow UNIX_TIMESTAMP() Works in MariaDB
In MariaDB, UNIX_TIMESTAMP()
is a built-in date and time function that returns a Unix timestamp, based on its argument (or lack of argument).
It works like this:
- When called without an argument, it returns a Unix timestamp (seconds since ‘1970-01-01 00:00:00’ UTC) as an unsigned integer.
- When called with an argument, it returns the value of the argument as seconds since ‘1970-01-01 00:00:00’ UTC.
The inverse function of UNIX_TIMESTAMP()
is FROM_UNIXTIME()
.
How TO_SECONDS() Works in MariaDB
In MariaDB, TO_SECONDS()
is a built-in date and time function that returns the number of seconds from year 0 to the given date or datetime expression.