Date/Time Functions and Operators
Data 360 Query Guide, mirrored from developer.salesforce.com: **Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API
markdownreferencev1697C-TYBYguide: data-cloud-query-guidestage: referencetrust: officialsource: developer.salesforce.comservice: data360interface: sqlDate/Time Functions and OperatorsData 360Data CloudData 360 Query Guide
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, andtimestamptzvalues. - Data 360 SQL outputs interval data in the ISO 8601 style. For example,
P1DT2H3M4Scorresponds to 1 day, 2 hours, 3 minutes, and 4 seconds.
For more information about supported types, see Date/Time Types.
Perform date arithmetic and time-zone conversion:
- Date/Time Operators — Arithmetic operators for dates, times, and intervals, and the
at time zoneconversion operator.
Retrieve or truncate subfields of a value:
- DATE_TRUNC — Truncate a value to a specified precision.
- EXTRACT and date_part — Retrieve a subfield, such as the year or hour, from a value.
- SECOND — Get the second from a timestamp or interval.
- MINUTE — Get the minute from a timestamp or interval.
- HOUR — Get the hour from a timestamp or interval.
- DAY — Get the day from a timestamp or interval.
- WEEK — Get the ISO 8601 week number from a timestamp.
- MONTH — Get the month from a timestamp or interval.
- QUARTER — Get the quarter from a timestamp.
- YEAR — Get the year from a timestamp or interval.
- DAYNAME — Return an abbreviated day name.
- MONTHNAME — Return an abbreviated month name.
- DAYOFWEEK — Return a day number from Sunday (
0) through Saturday (6).
Add to and measure the difference between dates:
- DATE_ADD — Add a multiple of a date unit to a date or timestamp.
- DATEDIFF — Measure the difference between two timestamps in a specified unit.
Build values from parts or convert from Unix epoch:
- MAKE_DATE — Create a date from year, month, and day fields.
- MAKE_TIME — Create a time from hour, minute, and seconds fields.
- MAKE_TIMESTAMP — Create a timestamp from component fields.
- TO_TIMESTAMP — Convert Unix epoch seconds to a timestamp.
Normalize intervals into larger units:
- JUSTIFY_DAYS — Represent 30-day periods as months.
- JUSTIFY_HOURS — Represent 24-hour periods as days.
- JUSTIFY_INTERVAL — Apply both adjustments with sign corrections.
Return current date and time values:
- CURRENT_DATE — The current date.
- CURRENT_TIME — The current time of day.
- CURRENT_TIMESTAMP — The current date and time.
- NOW — The current date and time.
- GETDATE — Return the current timestamp with time zone.
- SYSDATE — Return the current timestamp without time zone.
Align results with a fiscal or localized calendar:
- Fiscal Calendar Options — Configure standard or custom fiscal years.
- Localized Week Options — Define the start of a week and a year.