How to Remove Time from Date in Tableau
Working with dates in Tableau can sometimes feel like solving a small puzzle, especially when you see a timestamp like "12:00:00 AM" tacked onto every single date. It’s a common issue that clutters your visualizations and dashboards. This article will walk you through several straightforward methods to remove the time component from your dates in Tableau, so you can display your data cleanly and accurately.
First, Why Does Tableau Include the Time?
Before we jump into the solutions, it helps to understand why this happens. Data often comes into Tableau as a "datetime" field, even if the source only contains dates. A datetime value stores both the date and the time information, while a date value stores only the date.
When Tableau sees a field that could possibly contain time information, it often defaults to the more comprehensive datetime type. If your data doesn't actually have specific timestamps, Tableau simply fills in the time part with a default, usually midnight (12:00:00 AM). This doesn't mean your data is wrong, it just means it's being displayed with more detail than you need. Let’s get that cleaned up.
Method 1: The Easiest Fix - Changing the Data Type
The simplest way to remove the time is to tell Tableau to treat the field as a "Date" instead of a "datetime." This method changes the data type for the entire data source, making it a permanent and clean fix if you know you'll never need the original time information.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
When to use this method:
- Your source data is simple (like an Excel or CSV file).
- You are positive you don't need the time information anywhere in your workbook.
- You want a quick, global fix that applies everywhere you use the field.
Step-by-Step Instructions:
- Go to the Data Source page or the Data Pane. On the main worksheet view, look at the Data pane on the left side of your screen.
- Find your date field. You'll notice it has a small icon of a calendar with a clock next to it. That icon signifies it's a
datetimefield. - Right-click on the field name.
- Hover over "Change Data Type".
- Select "Date" from the dropdown menu.
That's it! The icon next to your field will change to a simple calendar (no clock), and anywhere you use that field, it will now appear without the time. Your chart axes, tables, and tooltips will all update automatically to show "MM/DD/YYYY" or your default date format.
Method 2: Using Calculated Fields for More Control
Sometimes, changing the original data type isn't ideal. You might want to keep the original datetime field for a time-specific calculation but also have a clean date field for other kinds of analysis. This is where calculated fields come in. Creating a calculation gives you a brand-new field while leaving the original one untouched.
When to use this method:
- You need to preserve the original
datetimefield for other purposes. - You want to perform data cleaning without altering the source data directly.
- The "Change Data Type" option is grayed out or not working as expected.
There are two primary functions you can use here: DATE() and DATETRUNC().
Using the DATE() Function
The DATE() function is designed specifically for this task. It takes a datetime value and returns just the date part.
How to Create the Calculated Field:
- Either right-click in a blank space of the Data pane and select "Create Calculated Field" or go to the "Analysis" menu at the top and select it.
- Give your new field a clear name, like "Order Date (Clean)" or "Ship Date Only."
- In the formula editor, type the following:
DATE([Your Datetime Field Name])For example, if your original field is named "Order Timestamp," the formula would be:
DATE([Order Timestamp])- Click "OK."
You will now see your new, clean date field in the Data pane. You can drag and drop this field into your views, and it will be completely free of any time information.
Using the DATETRUNC() Function
The DATETRUNC() function is a bit different but incredibly powerful. Its name stands for "Date Truncate," and it rounds your date down to the first moment of a specified date part (like the Day, Week, Month, or Year).
For removing time, you'll want to truncate to the 'day'.
How to set up the formula:
DATETRUNC('day', [Your Datetime Field Name])For example:
DATETRUNC('day', [Order Timestamp])Here’s an important point: DATETRUNC() actually returns a new datetime value. So, if you use this formula, your result will still look something like "1/15/2024 12:00:00 AM." Why use it, then? This function is excellent for standardizing timestamps. If you have data with various times throughout the day (9:15 AM, 3:30 PM, 11:00 PM), this function groups them all to the very beginning of that day.
To get a clean date from DATETRUNC(), you can either:
- Use the
DATE()function around it:DATE(DATETRUNC('day', [Your Datetime Field Name])). This gives you a pure date value without any time. - Use
DATETRUNC()on its own and then change the formatting on the visual itself (see Method 3 below). This keeps it as a continuousdatetimevalue, which can be useful for certain chart types.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
Method 3: Adjusting the Format Directly on the View
This final method is a cosmetic fix. It doesn't change the underlying data type but simply changes how the date is displayed in a specific chart or table. Think of it as painting a different color on the front of a house - the structure underneath is the same.
When to use this method:
- You need a quick, one-off visual adjustment for a single worksheet.
- You want to keep the underlying data as
datetime(for things like date filters that need a specific time range) but just show the date. - You need a custom date format (like "Jan-15-2024" or "January 2024").
Step-by-Step Instructions:
- Place your
datetimefield on the Rows or Columns shelf. - Right-click the blue or green pill representing your date field.
- Select "Format..." This will open the Format pane on the left.
- In the Format pane, under the "Header" or "Pane" tab, make sure you are formatting the correct field.
- Under the "Dates" dropdown, you can choose from a list of predefined formats like "March 2001" or "3/14/2001." Most of these will hide the time automatically.
- For ultimate control, select "Custom" and you can type your own format using symbols like "mm/dd/yyyy" or "mmmm d, yyyy."
Remember, this only affects the current view. If you use the same field in a new worksheet, you’ll have to apply the formatting again.
Which Method Is Right for You? A Quick Guide
Feeling a bit lost? Here’s a simple cheat sheet to help you decide:
- For a permanent fix everywhere: Use Method 1 (Change Data Type). It’s the cleanest and most straightforward.
- To keep your original data and create a new, clean version: Use Method 2 (Calculated Field with
DATE()). This gives you the best of both worlds - flexibility and a clean field. - To group all times in a day and standardize your data: Use Method 2 (Calculated Field with
DATETRUNC()). It’s perfect for preparing data for consistent analysis. - For just a quick visual clean-up on one chart: Use Method 3 (Formatting). It's fast and easy, but not a permanent data fix.
Final Thoughts
Cleaning dates in Tableau by removing the time component is a fundamental skill that tidies up your dashboards and makes your analysis clearer. Whether you choose a simple data type change, a flexible calculated field, or a quick visual format, you now have the tools to handle any datetime field Tableau throws your way.
We built Graphed because we know how much time can be lost on data prep tasks like this. The whole process of connecting data sources, creating calculated fields, and wrestling with formatting in complex BI tools slows everyone down. Instead of memorizing functions, we believe you should be able to simply ask questions in natural language, like "Show me sales by day for last month," and instantly get a clean, interactive chart - no manual data wrangling required.
Related Articles
How to Create Facebook Ads API for Claude Code
Create a Meta Marketing API access token that never expires, using a system user, so Claude Code can pull Facebook ad reports and manage campaigns.
ClickHouse vs Postgres: When to Switch to Columnar
Comparing ClickHouse vs PostgreSQL means matching storage architecture to workload. Row storage wins for transactions. Columnar wins for scan-heavy analytics.
Google Ads for Orthodontists: Get More Booked Consults
Most orthodontic Google Ads campaigns waste money on low-intent searches. The problem is structure, not the platform.