---
cuppy_hub: salesforce
cuppy_path: reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/datetime-func.md
cuppy_section: docs
cuppy_doc: 697C-TYBY
cuppy_doc_uuid: 063bc521-e001-4f07-b6e4-40254b6198ca
cuppy_permalink: https://cuppy.io/salesforce/d/697C-TYBY
cuppy_version: 1
cuppy_updated: 2026-10-23T16:16:52.575Z
cuppy_canonical: https://cuppy.io/salesforce/docs/reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/datetime-func
cuppy_mcp: https://cuppy.io/mcp
cuppy_body_sha256: d367dd8027142715b128c68e2acfa924e65e5fcb4a58a7c2d2d1a028e20b1475
# cuppy_body_sha256 is over the document body ALONE, excluding both generated blocks.
---

> Mirror of <https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/datetime-func.html> (Salesforce, Data 360 Query Guide), read 2026-10-23. Salesforce's own page is the authority; this copy exists because that site refuses non-browser readers.

## Date/Time Functions and Operators

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Functions and operators for working with dates, times, timestamps, and intervals. Use date/time functions to:

*   **Perform date arithmetic** with operators for addition, subtraction, and scaling, and convert between time zones.
*   **Extract and truncate** subfields such as the year, month, or hour from a value.
*   **Construct and convert** dates, times, and timestamps from component fields or Unix epoch values.
*   **Normalize intervals** into larger units.
*   **Get the current date and time**.
*   **Apply fiscal and localized calendars** to align results with your business calendar.

*   Most functions and operators accept `time`, `timestamp`, and `timestamptz` values.
*   Data 360 SQL outputs interval data in the [ISO 8601 style](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). For example, `P1DT2H3M4S` corresponds to 1 day, 2 hours, 3 minutes, and 4 seconds.

For more information about supported types, see [Date/Time Types](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/datetime.html).

Perform date arithmetic and time-zone conversion:

*   [Date/Time Operators](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/datetime-operators.html) — Arithmetic operators for dates, times, and intervals, and the `at time zone` conversion operator.

Retrieve or truncate subfields of a value:

*   [DATE_TRUNC](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/date-trunc.html) — Truncate a value to a specified precision.
*   [EXTRACT and date_part](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/extract.html) — Retrieve a subfield, such as the year or hour, from a value.
*   [SECOND](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/second.html) — Get the second from a timestamp or interval.
*   [MINUTE](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/minute.html) — Get the minute from a timestamp or interval.
*   [HOUR](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/hour.html) — Get the hour from a timestamp or interval.
*   [DAY](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/day.html) — Get the day from a timestamp or interval.
*   [WEEK](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/week.html) — Get the ISO 8601 week number from a timestamp.
*   [MONTH](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/month.html) — Get the month from a timestamp or interval.
*   [QUARTER](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/quarter.html) — Get the quarter from a timestamp.
*   [YEAR](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/year.html) — Get the year from a timestamp or interval.
*   [DAYNAME](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/dayname.html) — Return an abbreviated day name.
*   [MONTHNAME](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/monthname.html) — Return an abbreviated month name.
*   [DAYOFWEEK](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/dayofweek.html) — Return a day number from Sunday (`0`) through Saturday (`6`).

Add to and measure the difference between dates:

*   [DATE_ADD](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/date-add.html) — Add a multiple of a date unit to a date or timestamp.
*   [DATEDIFF](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/datediff.html) — Measure the difference between two timestamps in a specified unit.

Build values from parts or convert from Unix epoch:

*   [MAKE_DATE](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/make-date.html) — Create a date from year, month, and day fields.
*   [MAKE_TIME](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/make-time.html) — Create a time from hour, minute, and seconds fields.
*   [MAKE_TIMESTAMP](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/make-timestamp.html) — Create a timestamp from component fields.
*   [TO_TIMESTAMP](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/to-timestamp.html) — Convert Unix epoch seconds to a timestamp.

Normalize intervals into larger units:

*   [JUSTIFY_DAYS](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/justify-days.html) — Represent 30-day periods as months.
*   [JUSTIFY_HOURS](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/justify-hours.html) — Represent 24-hour periods as days.
*   [JUSTIFY_INTERVAL](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/justify-interval.html) — Apply both adjustments with sign corrections.

Return current date and time values:

*   [CURRENT_DATE](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/current-date.html) — The current date.
*   [CURRENT_TIME](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/current-time.html) — The current time of day.
*   [CURRENT_TIMESTAMP](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/current-timestamp.html) — The current date and time.
*   [NOW](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/now.html) — The current date and time.
*   [GETDATE](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/getdate.html) — Return the current timestamp with time zone.
*   [SYSDATE](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/sysdate.html) — Return the current timestamp without time zone.

Align results with a fiscal or localized calendar:

*   [Fiscal Calendar Options](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/fiscal-calendar-options.html) — Configure standard or custom fiscal years.
*   [Localized Week Options](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/localized-week-options.html) — Define the start of a week and a year.

*   [Date/Time Types](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/datetime.html)
*   [Scalar Functions](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/scalar-functions.html)


---
<!-- cuppy -->
You are reading one file. The same content is free over MCP at https://cuppy.io/mcp with no signup: ranked search across all 376 documents in this hub, the merged view when you work in a layer, known workarounds matched to the error you hit, and depth control so you spend tokens on what you need. Start with the `_hello` tool. How to connect: https://cuppy.io/salesforce/ Something wrong in this document? Report it with the `session feedback` tool on the same endpoint.
<!-- /cuppy -->
