[ Web Proxy ]
URL:
Viewing: https://docs.cloud.google.com/data-studio/formatdatetime [Back]  [Original]

Data Studio  |  Google Cloud Documentation Skip to main content
Google Cloud Documentation [Google Cloud Documentation]
Send feedback Stay organized with collections Save and categorize content based on your preferences.

FORMAT_DATETIME

Converts a date or date and time to formatted text.

Sample usage

FORMAT_DATETIME("%c", Order Date)

Syntax

FORMAT_DATETIME( format_string, date_expression )

Parameters

format_string - See Supported Format Elements For DATETIME for a list of format elements that this function supports.

date_expression - a Date or a Date & Time field or expression.

Return data type

Text 1

Examples

Example formula Output
FORMAT_DATETIME("%x", DATE "2008-12-25") 12/25/08
FORMAT_DATETIME("%c", DATETIME "2008-12-25 15:30:00") Thu Dec 25 15:30:00 2008
FORMAT_DATETIME("%b-%d-%Y", DATETIME "2008-12-25 15:30:00")

Dec-25-2008

Notes

This function is not available for compatibility mode date types.

  1. Date strings may be interpreted as compatibility modeDate data types. To preserve the specified format, change the field type to Text.
Send feedback

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-08-11 UTC.

Need to tell us more? [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-08-11 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page