Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Convert a timestamp column to a formatted string

Focus mode
Convert a timestamp column to a formatted string - AWS Glue

Format a timestamp column into a string based on a pattern. You can use Format timestamp to get date and time as a string with the desired format. You can define the format using Spark date syntax as well as most of the Python date codes.

For example, if you want your date string to be formatted like “2023-01-01 00:00”, you can define such format using the Spark syntax as “yyyy-MM-dd HH:mm” or the equivalent Python date codes as “%Y-%m-%d %H:%M”

To add a Format timestamp transform node in your job diagram
  1. Open the Resource panel and then choose Format timestamp to add a new transform to your job diagram. The node selected at the time of adding the node will be its parent.

  2. (Optional) On the Node properties tab, you can enter a name for the node in the job diagram. If a node parent is not already selected, then choose a node from the Node parents list to use as the input source for the transform.

  3. On the Transform tab, enter the name of the column to be converted.

  4. On the Transform tab, enter the Timestamp format pattern to use, expressed using Spark date syntax or Python date codes.

  5. (Optional) On the Transform tab, instead of converting the selected column, you can create a new one and keep the original by entering a name for the new column.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.