> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/server/reference/sql-functions/date-time-functions.md).

# Date & Time Functions

{% columns %}
{% column %}
{% content-ref url="/pages/PPZMtyeuPCN411Y1KVyN" %}
[Date and Time Units](/docs/server/reference/sql-functions/date-time-functions/date-and-time-units.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Reference keywords for date arithmetic. These units, such as DAY, HOUR, and MINUTE, specify the interval type used in functions like DATE\_ADD and EXTRACT.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/CqjThnLc7tZHCqhadbF5" %}
[ADD\_MONTHS](/docs/server/reference/sql-functions/date-time-functions/add_months.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Add a specific number of months to a date. This Oracle-compatible function simplifies date calculations involving monthly intervals.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/XwH4j9Mj5vp0cJAgTSGs" %}
[ADDDATE](/docs/server/reference/sql-functions/date-time-functions/adddate.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Add a time interval to a date. This function performs date arithmetic, adding a specified value like days or hours to a starting date.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/yTqRASIiQSrj9u0YJOuf" %}
[ADDTIME](/docs/server/reference/sql-functions/date-time-functions/addtime.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Add a time value to a date or time expression. This function sums two time arguments, returning a new time or datetime result.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/cQRJA6deKJvClsWMqzXk" %}
[CONVERT\_TZ](/docs/server/reference/sql-functions/date-time-functions/convert_tz.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Convert a datetime value between time zones. This function shifts a timestamp from a source time zone to a target time zone.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/JEnogdoXeM0tabtNbjGq" %}
[CURDATE](/docs/server/reference/sql-functions/date-time-functions/curdate.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Return the current date. This function outputs today's date as a value in 'YYYY-MM-DD' or YYYYMMDD format, depending on the context.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/SI51Qc0YlBzto0PHHIHP" %}
[CURRENT\_DATE](/docs/server/reference/sql-functions/date-time-functions/current_date.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Synonym for CURDATE(). Returns the current date as a value in 'YYYY-MM-DD' or YYYYMMDD format.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/rfXWoqMY81wEB7dsSdyt" %}
[CURRENT\_TIME](/docs/server/reference/sql-functions/date-time-functions/current_time.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Synonym for CURTIME(). Returns the current time as a value in 'HH:MM:SS' or HHMMSS format.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/Adu6hOPDzSNfS2m7lbVR" %}
[CURRENT\_TIMESTAMP](/docs/server/reference/sql-functions/date-time-functions/current_timestamp.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Synonym for NOW(). Returns the current date and time as a value in 'YYYY-MM-DD HH:MM:SS' or YYYYMMDDHHMMSS format.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/PID31rCS9xowXQ4RgdXm" %}
[CURTIME](/docs/server/reference/sql-functions/date-time-functions/curtime.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Return the current time. This function outputs the current time of day as a value in 'HH:MM:SS' or HHMMSS format.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/wrZQcoDeKQjnxj8R2d0R" %}
[DATE FUNCTION](/docs/server/reference/sql-functions/date-time-functions/date-function.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Extract the date part from a datetime expression. This function returns the year, month, and day portions, discarding the time component.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/qChrhg5YNPUQ9iVnT9CE" %}
[DATE\_ADD](/docs/server/reference/sql-functions/date-time-functions/date_add.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Complete DATE\_ADD() reference: DATE\_ADD(date, INTERVAL expr unit) syntax, negative interval support, unit keywords (DAY/MONTH/YEAR), and return types.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/gBgxDE0bY77DnWt1Hxnm" %}
[DATE\_FORMAT](/docs/server/reference/sql-functions/date-time-functions/date_format.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Complete DATE\_FORMAT reference for MariaDB. Complete function guide with syntax, parameters, return values, and usage examples with comprehensive examples.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/YGi1oHZAN4nrP2TUKhT1" %}
[DATE\_SUB](/docs/server/reference/sql-functions/date-time-functions/date_sub.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Subtract a time interval from a date. This function calculates a past date by subtracting a specified unit, such as days, from a starting value.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/FCjLh2KdEpUghUKa7jk4" %}
[DATEDIFF](/docs/server/reference/sql-functions/date-time-functions/datediff.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Complete DATEDIFF() reference: DATEDIFF(expr1,expr2) syntax, date vs datetime expression handling, time component ignore, and positive/negative results.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/JTXxJpCiIfEd0iSlEk9r" %}
[DAY](/docs/server/reference/sql-functions/date-time-functions/day.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Synonym for DAYOFMONTH(). Returns the day of the month (1-31) for a given date.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/m2cWr1ZggPYpPDf83LHI" %}
[DAYNAME](/docs/server/reference/sql-functions/date-time-functions/dayname.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Return the name of the weekday. This function returns the full name of the day, such as 'Monday' or 'Sunday', for a given date.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/whud1ZUsAYoqTTg2GYkA" %}
[DAYOFMONTH](/docs/server/reference/sql-functions/date-time-functions/dayofmonth.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Return the day of the month. This function extracts the day portion of a date, returning a number from 1 to 31.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/DQJhZbWHUjBA9QsrTeh1" %}
[DAYOFWEEK](/docs/server/reference/sql-functions/date-time-functions/dayofweek.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Return the weekday index. This function returns a number from 1 (Sunday) to 7 (Saturday) representing the day of the week.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/Y2AHrzMglIHQrUotFQzj" %}
[DAYOFYEAR](/docs/server/reference/sql-functions/date-time-functions/dayofyear.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Return the day of the year. This function returns a number from 1 to 366 indicating the day's position within the year.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/fRZBvooJ8yoyjQFeFjsu" %}
[EXTRACT](/docs/server/reference/sql-functions/date-time-functions/extract.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Extract a specific part of a date. This function retrieves components like YEAR, MONTH, DAY, or HOUR from a date or datetime expression.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/qbPRBjuiYxLKSF6NgGRH" %}
[FORMAT\_PICO\_TIME](/docs/server/reference/sql-functions/date-time-functions/format_pico_time.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Format a time in picoseconds. This function converts a numeric picosecond value into a human-readable string with units like ps, ns, us, ms, s, m, h, or d.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/vFG6E7jhJIDAansK3YGW" %}
[FROM\_DAYS](/docs/server/reference/sql-functions/date-time-functions/from_days.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Convert a day number to a date. This function returns a DATE value corresponding to the number of days since year 0.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/XQtfn6C0yvv3gfrzSrNM" %}
[FROM\_UNIXTIME](/docs/server/reference/sql-functions/date-time-functions/from_unixtime.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Convert a Unix timestamp to a datetime. This function formats a Unix timestamp as a date string or number in the current time zone.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/L0uGfWnGxqsyGEArZVeZ" %}
[GET\_FORMAT](/docs/server/reference/sql-functions/date-time-functions/get_format.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Return a format string. This function provides standard format strings for DATE\_FORMAT and STR\_TO\_DATE based on regions like 'USA' or 'EUR'.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/oE7MofyPNFQXrR55D7yF" %}
[HOUR](/docs/server/reference/sql-functions/date-time-functions/hour.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Extract the hour. This function returns the hour portion of a time or datetime value as a number from 0 to 23.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/82XHHbib8h3tPoCPW9zu" %}
[LAST\_DAY](/docs/server/reference/sql-functions/date-time-functions/last_day.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Return the last day of the month. This function calculates the date of the final day for the month containing the given date.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/avJP3OSAS68HhNkqxtNm" %}
[LOCALTIME](/docs/server/reference/sql-functions/date-time-functions/localtime.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Synonym for NOW(). Returns the current date and time in the session time zone.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/Bucgt31Y749K1g41bheF" %}
[LOCALTIMESTAMP](/docs/server/reference/sql-functions/date-time-functions/localtimestamp.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Synonym for NOW(). Returns the current date and time in the session time zone as a datetime value.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/3ghYWtRo3zvShUFPUu78" %}
[MAKEDATE](/docs/server/reference/sql-functions/date-time-functions/makedate.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Create a date from a year and day of year. This function constructs a DATE value given a year and the day number within that year.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/kfGrzHYGechsWGT2xeEU" %}
[MAKETIME](/docs/server/reference/sql-functions/date-time-functions/maketime.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Create a time from hour, minute, and second. This function constructs a TIME value from three numeric arguments.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/QENllzWw3CRKL57mITYe" %}
[MICROSECOND](/docs/server/reference/sql-functions/date-time-functions/microsecond.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Extract microseconds. This function returns the microsecond part of a time or datetime expression as a number from 0 to 999999.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/24ogHX5IUoktqWJzO1ur" %}
[Microseconds in MariaDB](/docs/server/reference/sql-functions/date-time-functions/microseconds-in-mariadb.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Understand microsecond precision. This concept page explains how MariaDB stores and handles fractional seconds in time data types.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/AsntGGeAeMmK5Gm4nCCQ" %}
[MINUTE](/docs/server/reference/sql-functions/date-time-functions/minute.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Extract the minute. This function returns the minute portion of a time or datetime value as a number from 0 to 59.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/bZao5e1NcBPYw9cQCPX6" %}
[MONTH](/docs/server/reference/sql-functions/date-time-functions/month.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Extract the month. This function returns the month portion of a date as a number from 1 (January) to 12 (December).
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/tM2i3s5FddIHq4ph7RHf" %}
[MONTHNAME](/docs/server/reference/sql-functions/date-time-functions/monthname.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Return the name of the month. This function returns the full name of the month, such as 'January' or 'December', for a given date.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/ko2vYbPcjPF58LUKxOTS" %}
[MONTHS\_BETWEEN](/docs/server/reference/sql-functions/date-time-functions/months_between.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Calculate the difference between two months.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/XcZdbR4WzlxfTTCJYTKA" %}
[NOW](/docs/server/reference/sql-functions/date-time-functions/now.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Complete NOW() function reference: NOW(\[precision]) and CURRENT\_TIMESTAMP synonyms, TIMESTAMP vs DATETIME types, timezone/DST handling, and fractional seconds.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/m2l3yQWwCKaJ8r6NOdbt" %}
[PERIOD\_ADD](/docs/server/reference/sql-functions/date-time-functions/period_add.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Add months to a period. This function adds a specified number of months to a period formatted as YYMM or YYYYMM.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/ZPRgcQpVLrmGKiA7DPjS" %}
[PERIOD\_DIFF](/docs/server/reference/sql-functions/date-time-functions/period_diff.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Calculate the difference between periods. This function returns the number of months between two periods formatted as YYMM or YYYYMM.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/eHOkpBFz3iUqqgDNW6FM" %}
[QUARTER](/docs/server/reference/sql-functions/date-time-functions/quarter.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Return the quarter of the year. This function returns a number from 1 to 4 indicating the quarter for a given date.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/NxYNTiMhFvBaTgl2tE6c" %}
[SEC\_TO\_TIME](/docs/server/reference/sql-functions/date-time-functions/sec_to_time.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Convert seconds to time. This function returns a TIME value corresponding to the number of seconds elapsed from the start of the day.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/fMsySWqHsgbLimgEkDR9" %}
[SECOND](/docs/server/reference/sql-functions/date-time-functions/second.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Extract the second. This function returns the second portion of a time or datetime value as a number from 0 to 59.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/JLEH7wSo3SyUnWi5xAqv" %}
[STR\_TO\_DATE](/docs/server/reference/sql-functions/date-time-functions/str_to_date.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Complete STR\_TO\_DATE() reference: parse strings to DATE/TIME/DATETIME, format specifiers (%Y %m %d %H %i %s), invalid input handling, and SQL\_MODE errors.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/vBT3I5zTluup9ci6WkW6" %}
[SUBDATE](/docs/server/reference/sql-functions/date-time-functions/subdate.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Subtract a time interval from a date. This synonym for DATE\_SUB calculates a past date by subtracting a specified unit from a starting value.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/lghiKYLGPVhlxMKes0Iq" %}
[SUBTIME](/docs/server/reference/sql-functions/date-time-functions/subtime.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Subtract a time value. This function subtracts one time or datetime expression from another and returns the result.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/gA0W9NxeOMc7YWwopgrH" %}
[SYSDATE](/docs/server/reference/sql-functions/date-time-functions/sysdate.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Return the time of execution. Unlike NOW(), which returns the start time of the statement, SYSDATE() returns the time it executes.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/vqhmZne1bO0pyVkH6WWZ" %}
[TIME](/docs/server/reference/sql-functions/date-time-functions/time-function.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Extract the time portion. This function returns the time part of a time or datetime expression.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/hhuiOxVzZmYpCOI2stdr" %}
[TIME\_FORMAT](/docs/server/reference/sql-functions/date-time-functions/time_format.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Format a time. This function formats a time value according to a format string, similar to DATE\_FORMAT but for time values.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/yrWFc9PC31lbAbBlDrKU" %}
[TIME\_TO\_SEC](/docs/server/reference/sql-functions/date-time-functions/time_to_sec.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
TIME\_TO\_SEC() converts a time value to the number of seconds, returning a DOUBLE that preserves microseconds.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/xrpbdBguntxyTpRJMYv8" %}
[TIMEDIFF](/docs/server/reference/sql-functions/date-time-functions/timediff.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Subtract two time values. This function calculates the difference between two time or datetime expressions.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/xP4HHILVcDgu970Z69wX" %}
[TIMESTAMP](/docs/server/reference/sql-functions/date-time-functions/timestamp-function.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Convert to datetime or add time. With one argument, it returns a datetime; with two, it adds a time expression to a date or datetime.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/E7c9OeELOEVZoOjl1uOh" %}
[TIMESTAMPADD](/docs/server/reference/sql-functions/date-time-functions/timestampadd.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Add an interval to a timestamp. This function adds a specified integer number of units (like MONTH or SECOND) to a datetime expression.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/usbDc8fyIRCqBmuxpm37" %}
[TIMESTAMPDIFF](/docs/server/reference/sql-functions/date-time-functions/timestampdiff.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Calculate the difference between timestamps. This function returns the difference between two datetime expressions in the specified unit.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/uhSGTjP7LJR1GQuuI3hX" %}
[TO\_DATE](/docs/server/reference/sql-functions/date-time-functions/to_date.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
TO\_DATE() converts a string to a date using a specified format, with optional handling for conversion errors.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/avQ9T99GlIoe1zUItvOf" %}
[TO\_DAYS](/docs/server/reference/sql-functions/date-time-functions/to_days.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Convert a date to a day number. This function returns the number of days between year 0 and the given date.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/2Jw8nL88yrnZKGvWWWUX" %}
[TO\_SECONDS](/docs/server/reference/sql-functions/date-time-functions/to_seconds.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Convert a date to seconds. This function returns the number of seconds from year 0 to the given date or datetime.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/niNsDyYlot0cyqaSIxRw" %}
[TRUNC](/docs/server/reference/sql-functions/date-time-functions/trunc.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Truncate a date. In Oracle mode, this function truncates a date value to a specified unit of measure.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/rEVeh6xWLaCU4BQ8zgCw" %}
[UNIX\_TIMESTAMP](/docs/server/reference/sql-functions/date-time-functions/unix_timestamp.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Return a Unix timestamp. This function returns the number of seconds since the Unix Epoch ('1970-01-01 00:00:00' UTC).
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/N168PmGRA4yGZqc4Qt76" %}
[UTC\_DATE](/docs/server/reference/sql-functions/date-time-functions/utc_date.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Return the current UTC date. This function returns the current Coordinated Universal Time date in 'YYYY-MM-DD' or YYYYMMDD format.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/4pPFe595SJKdxn4mZlIV" %}
[UTC\_TIME](/docs/server/reference/sql-functions/date-time-functions/utc_time.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Return the current UTC time. This function returns the current Coordinated Universal Time in 'HH:MM:SS' or HHMMSS format.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/xjHebtBm3QT1Dl7aRh5E" %}
[UTC\_TIMESTAMP](/docs/server/reference/sql-functions/date-time-functions/utc_timestamp.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Return the current UTC timestamp. This function returns the current Coordinated Universal Time date and time.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/vGpaqSmNuYQhsj0NlMQL" %}
[WEEK](/docs/server/reference/sql-functions/date-time-functions/week.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Return the week number. This function returns the week number for a date, with an optional mode to define the start of the week.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/4pkCDGPFXO87XriiicCj" %}
[WEEKDAY](/docs/server/reference/sql-functions/date-time-functions/weekday.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Return the weekday index. This function returns the index of the day of the week (0=Monday, 6=Sunday).
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/DYgT9NuZ4mu3NA259nLV" %}
[WEEKOFYEAR](/docs/server/reference/sql-functions/date-time-functions/weekofyear.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Return the calendar week. This function returns the week number of the date (1-53), equivalent to WEEK(date, 3).
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/c1FTRWYTGBh3Vgt8v98C" %}
[YEAR](/docs/server/reference/sql-functions/date-time-functions/year.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Extract the year. This function returns the year portion of a date as a number from 1000 to 9999.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/PCPPvH1Fj1dmh7QE4QA0" %}
[YEARWEEK](/docs/server/reference/sql-functions/date-time-functions/yearweek.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Return the year and week. This function returns the year and week number for a date, useful for grouping results by week.
{% endcolumn %}
{% endcolumns %}
