Skip to content

[auto-build] backport-56-643695fc4475ea8906009da283fcc3489e425a96 -> release-x.56.x #389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions _docs/v0.56/questions/query-builder/expressions-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ For an introduction to expressions, check out the [overview of custom expression
- [concat](./expressions/concat)
- [contains](#contains)
- [date](#date)
- [datetime](#datetime)
- [doesNotContain](#doesnotcontain)
- [domain](#domain)
- [endsWith](#endswith)
Expand Down Expand Up @@ -107,6 +108,8 @@ For an introduction to expressions, check out the [overview of custom expression
- [quarterName](#quartername)
- [relativeDateTime](#relativedatetime)
- [second](#second)
- [timeSpan](#timespan)
- [today](#today)
- [week](#week)
- [weekday](#weekday)
- [year](#year)
Expand Down Expand Up @@ -434,7 +437,7 @@ Example: `sqrt([Hypotenuse])`.

Databases that don't support `sqrt`: SQLite.

Related: [Power](#power).
Related: [power](#power).

## String functions

Expand Down Expand Up @@ -501,9 +504,12 @@ Related: [datetime](#datetime)

> Available on PostgreSQL, MySQL/MariaDB, BigQuery, Redshift, ClickHouse, and Snowflake

Converts a datetime string to a datetime.
Converts a datetime string or bytes to a datetime.

Syntax: `datetime(column)`
Syntax: `datetime(value, mode)`

- `value`: The string, bytes, or number to convert to a datetime.
- `mode`: Optional. The mode indicating the format. One of: `"simple"`, `"iso"`, `"simpleBytes"`, `"isoBytes"`, `"unixSeconds"`, `"unixMilliseconds"`, `"unixMicroseconds"`, `"unixNanoseconds"`. Default is `"iso"`.

Example: `datetime("2025-03-20 12:45:04")`

Expand Down Expand Up @@ -938,6 +944,16 @@ Syntax: `timeSpan(number, text)`

Example: `[Orders → Created At] + timeSpan(7, "day")` will return the date 7 days after the `Created At` date.

### today

Returns the current date (without time).

Syntax: `today()`

Example: `today()` would return the current date, such as `2025-05-04`.

Related: [now](#now).

### [week](./expressions/week)

Takes a datetime and returns the week as an integer.
Expand Down
24 changes: 21 additions & 3 deletions _site/docs/v0.56/questions/query-builder/expressions-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -4908,6 +4908,7 @@ <h1 id="list-of-expressions">List of expressions</h1>
<li><a href="./expressions/concat">concat</a></li>
<li><a href="#contains">contains</a></li>
<li><a href="#date">date</a></li>
<li><a href="#datetime">datetime</a></li>
<li><a href="#doesnotcontain">doesNotContain</a></li>
<li><a href="#domain">domain</a></li>
<li><a href="#endswith">endsWith</a></li>
Expand Down Expand Up @@ -4954,6 +4955,8 @@ <h1 id="list-of-expressions">List of expressions</h1>
<li><a href="#quartername">quarterName</a></li>
<li><a href="#relativedatetime">relativeDateTime</a></li>
<li><a href="#second">second</a></li>
<li><a href="#timespan">timeSpan</a></li>
<li><a href="#today">today</a></li>
<li><a href="#week">week</a></li>
<li><a href="#weekday">weekday</a></li>
<li><a href="#year">year</a></li>
Expand Down Expand Up @@ -5299,7 +5302,7 @@ <h3 id="sqrt">sqrt</h3>

<p>Databases that don’t support <code class="language-plaintext highlighter-rouge">sqrt</code>: SQLite.</p>

<p>Related: <a href="#power">Power</a>.</p>
<p>Related: <a href="#power">power</a>.</p>

<h2 id="string-functions">String functions</h2>

Expand Down Expand Up @@ -5376,9 +5379,14 @@ <h3 id="datetime">datetime</h3>
<p>Available on PostgreSQL, MySQL/MariaDB, BigQuery, Redshift, ClickHouse, and Snowflake</p>
</blockquote>

<p>Converts a datetime string to a datetime.</p>
<p>Converts a datetime string or bytes to a datetime.</p>

<p>Syntax: <code class="language-plaintext highlighter-rouge">datetime(value, mode)</code></p>

<p>Syntax: <code class="language-plaintext highlighter-rouge">datetime(column)</code></p>
<ul>
<li><code class="language-plaintext highlighter-rouge">value</code>: The string, bytes, or number to convert to a datetime.</li>
<li><code class="language-plaintext highlighter-rouge">mode</code>: Optional. The mode indicating the format. One of: <code class="language-plaintext highlighter-rouge">"simple"</code>, <code class="language-plaintext highlighter-rouge">"iso"</code>, <code class="language-plaintext highlighter-rouge">"simpleBytes"</code>, <code class="language-plaintext highlighter-rouge">"isoBytes"</code>, <code class="language-plaintext highlighter-rouge">"unixSeconds"</code>, <code class="language-plaintext highlighter-rouge">"unixMilliseconds"</code>, <code class="language-plaintext highlighter-rouge">"unixMicroseconds"</code>, <code class="language-plaintext highlighter-rouge">"unixNanoseconds"</code>. Default is <code class="language-plaintext highlighter-rouge">"iso"</code>.</li>
</ul>

<p>Example: <code class="language-plaintext highlighter-rouge">datetime("2025-03-20 12:45:04")</code></p>

Expand Down Expand Up @@ -5824,6 +5832,16 @@ <h3 id="timespan">timeSpan</h3>

<p>Example: <code class="language-plaintext highlighter-rouge">[Orders → Created At] + timeSpan(7, "day")</code> will return the date 7 days after the <code class="language-plaintext highlighter-rouge">Created At</code> date.</p>

<h3 id="today">today</h3>

<p>Returns the current date (without time).</p>

<p>Syntax: <code class="language-plaintext highlighter-rouge">today()</code></p>

<p>Example: <code class="language-plaintext highlighter-rouge">today()</code> would return the current date, such as <code class="language-plaintext highlighter-rouge">2025-05-04</code>.</p>

<p>Related: <a href="#now">now</a>.</p>

<h3 id="week"><a href="./expressions/week">week</a></h3>

<p>Takes a datetime and returns the week as an integer.</p>
Expand Down