LogoLogo
ProductsPricingGlossary Launch Acho
  • 🎉Welcome
  • Introduction
  • What is Acho?
  • How does Acho work?
    • Proof of Concept (PoC)
  • App Builder
    • Get Started
    • Core Concepts
    • Overview
    • App construction
      • App Configuration
      • Pages
      • Interactions
        • Add an interaction
        • Add conditions to interactions
        • Event payload
        • Ordering interactions with action flow
        • Transformer
        • Actions
          • Navigation
          • Element
          • Data Source
          • App
          • Page
          • API Service
          • Database
          • Media Service
      • Table
      • Metric
      • Query
      • Data Store
      • Elements
        • Table & Chart
          • Searchable Table
          • Table
          • Chart
          • Score Card
        • Form Elements
          • Form
          • Search Bar
          • Checkbox
          • Date Picker
          • Custom Form
          • Input
          • Multiselect
          • Radio Button
          • Radio List
          • Rich Text Editor
          • Select
          • Switch
          • Textarea
          • Upload
        • Web Elements
          • Badge
          • Button
          • Clickable
          • Collapse Menu
          • Divider
          • Icon
          • Image
          • Link
          • Message
          • Modal
          • Notification
          • Pagination
          • Popover
          • Rate
          • Rich Text
          • Tabs
          • Text
        • Layout Elements
          • Container
          • List
        • Advanced elements
          • Code Block
          • Condition
          • Print
        • CSS Styles
          • General techniques
          • Layout
          • Spacing
          • Size
          • Position
          • Typography
          • Background
          • Border
          • Effect
        • Form Check
        • Tooltip
      • Accessors
      • Plugin Store
    • Popular Use Cases
      • Build a chart from Table Nodes
      • Create a table
      • Create a list
      • Create a filter
      • Create a search bar
      • Use Custom Form Container to collect user inputs
      • Drill down on a table
      • Download file from query node
      • Set loading animations
      • Modify a database
      • Navigate to a different page
      • Set up dynamic routing
      • Update app data using accessors
      • Create a Chart with Code Block and D3 Library
      • Rich text and rich text editor
      • Send an Email via Mailjet Plugin
    • Preview
    • Publish
      • Embed published app on website
    • Version Control
    • App User Management
      • Onboarding Page
      • Sign in page
      • Guest Isolation and Private Session
    • Theme
    • FAQ
  • Acho Studio
    • Quick Start
    • Resources
      • Add a resource
      • Supported data sources
        • Airtable
        • Amazon Ads
        • Amplitude
        • Amazon Seller Partner
        • Apify Dataset
        • Appstore
        • Asana
        • API Connector
        • API Template
        • AWS CloudTrail
        • Azure Table Storage
        • Batch Files
        • Bamboo HR
        • BigCommerce
        • BigQuery
        • Bing Ads
        • Braintree
        • Cart.com
        • Chargebee
        • Chargify
        • Chartmogul
        • Clickhouse
        • Close.com
        • CockroachDB
        • Confluence
        • Customer.io
        • Delighted
        • Dixa
        • Drift
        • Facebook Marketing
        • Freshdesk
        • Freshsales
        • Freshservice
        • GitHub
        • GitLab
        • Google Ads
        • Google Analytics
        • Google Sheets
        • Google Search Console
        • Greenhouse
        • Harness
        • Harvest
        • HubSpot
        • IBM Db2
        • Instagram
        • Intercom
        • Iterable
        • Jenkins
        • Jira
        • Kafka
        • Klaviyo
        • Kustomer
        • Lemlist
        • Lever Hiring
        • LinkedIn Ads
        • Linnworks
        • Mailchimp
        • Marketo
        • Microsoft Teams
        • Mixpanel
        • Monday
        • MongoDB
        • MySQL
        • My Hours
        • NetSuite
        • Notion
        • Okta
        • OneDrive
        • OneSignal
        • Oracle DB
        • Outreach
        • PagerDuty
        • Paypal Transaction
        • Paystack
        • Pipedrive
        • PersistIq
        • Pinterest
        • Plaid
        • PostgreSQL
        • PostHog
        • PrestaShop
        • Qualaroo
        • QuickBooks
        • Recharge
        • Recurly
        • Remote File
        • S3
        • Salesforce
        • Salesloft
        • SearchMetrics
        • Sendgrid
        • Sentry
        • Short.io
        • Shopify
        • Single File
        • Slack
        • Smartsheets
        • Snapchat Marketing
        • Snowflake
        • SQL Server
        • Square
        • Stripe
        • SurveyMonkey
        • Tempo
        • TikTok Marketing
        • Trello
        • Twilio
        • Typeform
        • VictorOps
        • WooCommerce
        • YouTube Analytics
        • Zendesk Chat
        • Zendesk Sunshine
        • Zendesk Talk
        • Zendesk Support
        • Zenloop
        • Zoho CRM
        • Zoom
        • Zuora
    • Data Prep (Projects)
      • Create a Data Prep Project
        • Create a table tab
        • Copy a table tab
        • Hide a table tab
      • Apply an action
        • View
          • Hide Columns
          • Filter
          • Sort
          • Cut
          • Rename
          • Move Column
        • Combine Tables
          • Join
          • Union
        • Transformation
          • Pivot Table
          • Unpivot
        • Data Cleaning
          • Cleanse
          • Replace
          • Change Type
          • Deduplicate
          • Split
          • Flatten
        • Tools
          • Formula
          • SQL Editor
            • SQL Editor Queries
            • All functions in Formula/SQL
              • Mathematical Functions
              • String Functions
              • Date Functions
              • Datetime Functions
              • Time Functions
              • Timestamp Functions
              • Conditional Functions
              • Type Conversion
              • Other Functions
        • Reserved Keywords
      • Pipeline
      • Edit your pipelines
      • Generate column summary for inspection
      • Use URL to access and share your project
      • Write a description for your project
      • Delete a resources/project/tab
    • Data Flow
      • Export data
        • Download CSV files
        • Excel Connector
        • Google Sheets Connector
        • Embed a table on your website
          • Data Usage Agreement
        • Apache Superset
        • Chartio
        • Looker
        • Metabase
        • Power BI
        • Qlik
        • Tableau
        • MongoDB
        • MySQL
        • MSSQL
        • Snowflake
        • PostgreSQL
        • BigQuery
    • Set up Data Sync
    • FAQ
  • Organization
    • Get started
    • Create an organization
    • Invite people to your organization
    • Share your resources
    • Share your projects
    • Share your apps
    • Change payment method on file
  • FAQ
    • I can't find data after uploading a big CSV file
Powered by GitBook
On this page
  • CURRENT_TIME
  • EXTRACT
  • TIME
  • TIME_ADD
  • TIME_SUB
  • TIME_DIFF
  • TIME_TRUNC
  • FORMAT_TIME
  • PARSE_TIME
  • Details about date_part
  • Supported Format Elements

Was this helpful?

  1. Acho Studio
  2. Data Prep (Projects)
  3. Apply an action
  4. Tools
  5. SQL Editor
  6. All functions in Formula/SQL

Time Functions

PreviousDatetime FunctionsNextTimestamp Functions

Last updated 3 years ago

Was this helpful?

CURRENT_TIME

CURRENT_TIME([timezone])

Description:

Return the current time as a time variable.

Input

  • timezone(optional, STRING): The default timezone is UTC. You can optionally specify a .

Return Data Type

TIME

Example:

CURRENT_TIME()

Result: 18:23:04.347264

CURRENT_TIME("merica/New_York")

Result: 14:23:04.347264

EXTRACT

EXTRACT(part FROM time)

Description

Return a part of the given time object.

Input

  • time: a TIME object or column

Return Data Type

INTEGER

Example

EXTRACT(HOUR FROM TIME "15:30:00")

Result: 15

TIME

TIME(time_expression,[timezone])

Description:

Convert a string, timestamp, or datetime expression to a time variable in a "hh-mm-ss" format.

Input

  • time_expression: a STRING, TIMESTAMP, or DATETIME object or column

Return Data Type

TIME

Example:

TIME(TIMESTAMP("2020-12-25 15:30:00+08"))

Result: 07:30:00

TIME(TIMESTAMP("2020-12-25 15:30:00+08"), "America/Los_Angeles")

Result: 23:30:00

TIME_ADD

TIME_ADD(time, INTERVAL integer time_part)

Description:

Add a specified time interval to the given time.

Input

  • integer: the number of time_part

  • time: a TIME object or column

Return Data Type

TIME

Example:

TIME_ADD(TIME("15:30:00"), INTERVAL 10 MINUTE)

Result: 15:40:00

TIME_SUB

TIME_SUB(time, INTERVAL integer time_part)

Description:

Subtract a specified time interval to the given time. T

Input

  • integer: the number of time_part

  • time: a TIME object or column

Return Data Type

TIME

Example:

TIME_SUB(TIME("15:30:00"), INTERVAL 10 MINUTE)

Result: 15:20:00

TIME_DIFF

TIME_DIFF(time1, time2, time_part)

Description:

Return the difference between two times(time1-time2). The difference is expressed in the unit of time_part.

Input

  • time1: a TIME object or column

  • time2: a TIME object or column

Return Data Type

INTEGER

Example:

TIME_DIFF(TIME("15:30:00"), TIME("14:35:00"), MINUTE)

Result: 55

TIME_TRUNC

TIME_TRUNC(time, time_part)

Description:

Truncate a specific time to the start of a given unit of duration and returns a new time. The unit of duration is defined by time_part.

Input

  • time: a TIME object or column

Return Data Type

TIME

Example:

TIME_TRUNC(TIME("15:30:00"), HOUR)

Result: 15:00:00

FORMAT_TIME

FORMAT_TIME(format, time)

Description:

Input

  • time: a Time object or column

Return Data Type

STRING

Example:

FORMAT_TIME("%R", TIME "15:30:00")

Result: 15:30

PARSE_TIME

PARSE_TIMESTAMP(format, time_expression)

Description:

Convert a string to a time variable according to the specified format.

Input

  • time_expression: a STRING object or column

Return Data Type

TIME

Example:

PARSE_TIME("%I:%M:%S", "07:30:00")

Result: 07:30:00

Details about date_part

Part

Description

MICROSECOND

The microsecond of the time.

MILLISECOND

The millisecond of the time.

SECOND

The second of the time.

MINUTE

The minute of the time.

HOUR

The hour of the time.

Supported Format Elements

Format element

Description

Example

%H

Return the hour in the 24-hour clock (00-23).

15

%I

Return the hour in the 12-hour clock (01-12).

03

%k

Return the hour (0-23) in the 24-hour clock without leading 0.

15

%l

Return the hour (1-12) in the 12-hour clock without leading 0

3

%M

Return the minute of the time (00-59).

31

%n

Return a newline character.

%P

Return a lowercase "am" or "pm".

pm

%p

Return an uppercase "AM" or "PM".

PM

%R

Return the time in a format of "%H:%M".

15:31

%r

Return the time in the 12-hour clock with AM/PM notation.

03:31:13 PM

%S

Return the second of the time (00-60).

13

%T

Return the time in a format of %H:%M:%S.

15:31:13

%t

Return a tab character.

%X

Return the time in a format of "HH:MM:SS"

15:31:13

%%

Return a single "%" character.

%

%E#S

Return the seconds with the given number of digits of fractional precision. The "#" should be replaced by a number.

"%E3S" returns 37.021

%E*S

Return the seconds with full fractional precision.

37.021851

part: can be one of the following: MICROSECOND, MILLISECOND, SECOND, MINUTE, or HOUR (See more )

timezone: (optional, STRING) It is only available for TIMESTAMP inputs. The default timezone is UTC. You can optionally specify a

time_part: The unit of the time inteval. It can be one of the following: MICROSECOND, MILLISECOND, SECOND, MINUTE, HOUR (See more )

time_part: The unit of the time inteval. It can be one of the following: MICROSECOND, MILLISECOND, SECOND, MINUTE, HOUR (See more )

time_part: The unit of the difference between two times. It can be one of the following: MICROSECOND, MILLISECOND, SECOND, MINUTE, or HOUR (See more )

time_part: The unit of duration. It can be one of the following MICROSECOND, MILLISECOND, SECOND, MINUTE, HOUR (See more )

Transform a time variable into a string variable in a specific format. To see supported format elements, visit .

format: a STRING expression. To see supported format elements, visit .

format: a STRING expression. To see supported format elements, visit .

time zone
time zone.
here
details
details
details
details
details
here
here