> ## Documentation Index
> Fetch the complete documentation index at: https://docs.condotta.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Date & Time

> Format, parse, add/subtract, compare, and convert dates and times.

The Date & Time connector provides operations for working with dates and times: formatting, parsing, timezone conversion, arithmetic, and comparisons.

> [!NOTE]
>
> No connection required; this utility connector works out of the box.

## Tools

> [accordion] now: Get current date/time
>
> **timezone** `string`
>
> Timezone (e.g., `America/New_York`). Defaults to UTC.
>
> **format** `string`
>
> Output format. Defaults to ISO 8601.
>
> **Example request:**
>
> ```json theme={null}
> { "timezone": "America/New_York", "format": "YYYY-MM-DD HH:mm:ss" }
> ```
>
> **Example response:**
>
> ```json theme={null}
> { "result": "2025-06-15 14:30:22" }
> ```

> [accordion] format: Format date to string
>
> **date** `string` *required*
>
> Date to format (ISO 8601, Unix timestamp, or parseable string).
>
> **format** `string` *required*
>
> Output format string (e.g., `YYYY-MM-DD HH:mm:ss`, `DD/MM/YYYY`).
>
> **timezone** `string`
>
> Convert to timezone before formatting.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "date": "2025-03-15T10:30:00Z",
>   "format": "dddd, MMMM D, YYYY [at] hh:mm A",
>   "timezone": "America/Los_Angeles"
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> { "result": "Saturday, March 15, 2025 at 03:30 AM" }
> ```

> [accordion] parse: Parse date string
>
> Parse a date string to ISO 8601 format.
>
> **date** `string` *required*
>
> Date string to parse.
>
> **inputFormat** `string`
>
> Expected input format (e.g., `MM/DD/YYYY`).
>
> **timezone** `string`
>
> Timezone to interpret the date in. Defaults to UTC.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "date": "15/03/2025 14:30",
>   "inputFormat": "DD/MM/YYYY HH:mm",
>   "timezone": "Europe/London"
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> { "iso": "2025-03-15T14:30:00.000Z" }
> ```

> [accordion] add: Add duration to date
>
> **date** `string` *required*
>
> Starting date.
>
> **value** `number` *required*
>
> Amount to add (can be negative).
>
> **unit** `string` *required*
>
> Unit: `year`, `month`, `week`, `day`, `hour`, `minute`, `second`, or `millisecond`.
>
> **Example request:**
>
> ```json theme={null}
> { "date": "2025-01-15T00:00:00Z", "value": 30, "unit": "day" }
> ```
>
> **Example response:**
>
> ```json theme={null}
> { "iso": "2025-02-14T00:00:00.000Z" }
> ```

> [accordion] subtract: Subtract duration from date
>
> **date** `string` *required*
>
> Starting date.
>
> **value** `number` *required*
>
> Amount to subtract.
>
> **unit** `string` *required*
>
> Unit: `year`, `month`, `week`, `day`, `hour`, `minute`, `second`, or `millisecond`.
>
> **Example request:**
>
> ```json theme={null}
> { "date": "2025-06-01T12:00:00Z", "value": 3, "unit": "month" }
> ```
>
> **Example response:**
>
> ```json theme={null}
> { "iso": "2025-03-01T12:00:00.000Z" }
> ```

> [accordion] diff: Difference between dates
>
> **date1** `string` *required*
>
> First date.
>
> **date2** `string` *required*
>
> Second date.
>
> **unit** `string` (default: day)
>
> Unit for the result.
>
> **precise** `boolean` (default: false)
>
> Return decimal value.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "date1": "2025-12-25T00:00:00Z",
>   "date2": "2025-01-01T00:00:00Z",
>   "unit": "day"
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> { "value": 358, "unit": "day" }
> ```

> [accordion] timezone: Convert between timezones
>
> **date** `string` *required*
>
> Date to convert.
>
> **from** `string`
>
> Source timezone.
>
> **to** `string` *required*
>
> Target timezone.
>
> **format** `string`
>
> Output format.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "date": "2025-06-15 09:00",
>   "from": "America/New_York",
>   "to": "Asia/Tokyo",
>   "format": "YYYY-MM-DD HH:mm:ss Z"
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> { "result": "2025-06-15 22:00:00 +09:00" }
> ```

> [accordion] start-of: Start of time period
>
> Get the start of a year, month, week, day, hour, minute, or second.
>
> **date** `string` *required*
>
> Reference date.
>
> **unit** `string` *required*
>
> Unit: `year`, `month`, `week`, `day`, `hour`, `minute`, or `second`.
>
> **Example request:**
>
> ```json theme={null}
> { "date": "2025-06-15T14:30:00Z", "unit": "month" }
> ```
>
> **Example response:**
>
> ```json theme={null}
> { "iso": "2025-06-01T00:00:00.000Z" }
> ```

> [accordion] end-of: End of time period
>
> Get the end of a year, month, week, day, hour, minute, or second.
>
> **date** `string` *required*
>
> Reference date.
>
> **unit** `string` *required*
>
> Unit: `year`, `month`, `week`, `day`, `hour`, `minute`, or `second`.
>
> **Example request:**
>
> ```json theme={null}
> { "date": "2025-06-15T14:30:00Z", "unit": "month" }
> ```
>
> **Example response:**
>
> ```json theme={null}
> { "iso": "2025-06-30T23:59:59.999Z" }
> ```

> [accordion] is-before: Check if before another date
>
> **date** `string` *required*
>
> Date to check.
>
> **compareTo** `string` *required*
>
> Date to compare against.
>
> **unit** `string`
>
> Comparison granularity.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "date": "2025-01-15T00:00:00Z",
>   "compareTo": "2025-06-01T00:00:00Z",
>   "unit": "month"
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> { "result": true }
> ```

> [accordion] is-after: Check if after another date
>
> **date** `string` *required*
>
> Date to check.
>
> **compareTo** `string` *required*
>
> Date to compare against.
>
> **unit** `string`
>
> Comparison granularity.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "date": "2025-12-01T00:00:00Z",
>   "compareTo": "2025-06-01T00:00:00Z"
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> { "result": true }
> ```

> [accordion] is-between: Check if between two dates
>
> **date** `string` *required*
>
> Date to check.
>
> **start** `string` *required*
>
> Start of range.
>
> **end** `string` *required*
>
> End of range.
>
> **unit** `string`
>
> Comparison granularity.
>
> **inclusivity** `string` (default: ())
>
> Boundary inclusivity: `()`, `[]`, `[)`, or `(]`.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "date": "2025-06-15T00:00:00Z",
>   "start": "2025-06-01T00:00:00Z",
>   "end": "2025-06-30T23:59:59Z",
>   "inclusivity": "[]"
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> { "result": true }
> ```

> [accordion] relative: Human-readable relative time
>
> Returns strings like "2 hours ago" or "in 3 days".
>
> **date** `string` *required*
>
> Date to format.
>
> **from** `string`
>
> Reference date (defaults to now).
>
> **withoutSuffix** `boolean` (default: false)
>
> Omit "ago" or "in" prefix/suffix.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "date": "2025-06-10T00:00:00Z",
>   "from": "2025-06-15T00:00:00Z"
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> { "text": "5 days ago" }
> ```

> [accordion] parts: Extract date components
>
> Extract year, month, day, hour, minute, second, etc.
>
> **date** `string` *required*
>
> Date to extract from.
>
> **timezone** `string`
>
> Timezone for extraction.
>
> **Example request:**
>
> ```json theme={null}
> { "date": "2025-06-15T14:30:00Z", "timezone": "America/New_York" }
> ```
>
> **Example response:**
>
> ```json theme={null}
> {
>   "year": 2025,
>   "month": 6,
>   "day": 15,
>   "hour": 10,
>   "minute": 30,
>   "second": 0,
>   "millisecond": 0,
>   "dayOfWeek": 0,
>   "dayOfYear": 166,
>   "weekOfYear": 25,
>   "quarter": 2,
>   "isLeapYear": false,
>   "daysInMonth": 30,
>   "unix": 1750000200,
>   "iso": "2025-06-15T14:30:00.000Z"
> }
> ```

> [accordion] unix: Convert to/from Unix timestamp
>
> **value** `string | number` *required*
>
> Date string or Unix timestamp.
>
> **toUnix** `boolean` (default: true)
>
> `true` = date to timestamp, `false` = timestamp to date.
>
> **milliseconds** `boolean` (default: false)
>
> Use milliseconds instead of seconds.
>
> **Example request:**
>
> ```json theme={null}
> { "value": "2025-06-15T00:00:00Z", "toUnix": true }
> ```
>
> **Example response:**
>
> ```json theme={null}
> { "unix": 1749945600 }
> ```

> [accordion] list-timezones: List timezone identifiers
>
> Returns a list of common timezone identifiers. No parameters required.
>
> **Example request:**
>
> ```json theme={null}
> {}
> ```
>
> **Example response:**
>
> ```json theme={null}
> {
>   "timezones": [
>     "UTC",
>     "America/New_York",
>     "America/Chicago",
>     "America/Denver",
>     "America/Los_Angeles",
>     "Europe/London",
>     "Europe/Paris",
>     "Asia/Tokyo",
>     "Australia/Sydney",
>     "Pacific/Auckland"
>   ],
>   "count": 26
> }
> ```

> [card] [Try this free for 14 days](https://preview.condotta.ai/signup)
>
> Start a 14-day trial on Band 1. At day 14, choose your band, or stop.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.