Skip to main content
All CollectionsFAQGeneral
Switching Between Date and DateTime
Switching Between Date and DateTime

A detailed guide to switching between Date and DateTime

Christian Dreyer avatar
Written by Christian Dreyer
Updated over a year ago

You can change custom DateTime fields into Date fields, and vice versa. There are two ways of doing this:

  1. Change the type in the settings modal of the specific field

  2. Change field types in bulk, using our Powertool

🚨Read about our Date and DateTime fields in this article.

Switching from DateTime --> Date

When you switch a DateTime field to be of type Date, this means that we remove the timestamp from the data on the field. You can choose to push the Date "backward" or "forward", when saving the field. This means that your DateTimes are either pushed forward to the next GMT day, or backward to the same GMT day. For example, the DateTime of December 31, 2023 15:00 (GMT) can either be pushed backward to December 31, 2023 00:00 (GMT), or forward to January 1, 2024 00:00 (GMT).

🚨Once you change a DateTime field to type: Date, the time value is removed permanently, even if you switch back!

🚨It is important to note that the logic for pushing forward and backward uses GMT. This means that Planhat reads your DateTime values, and if the Time value is different from 00:00 AM in GMT, Planhat can push the DateTime into the next Day (forward) or keep it in the same day (backward). This can perhaps best be explained through 2 different timezone scenarios - one where you are viewing Planhat in Los Angeles time (GMT-7), and one where you are viewing Planhat from Sydney time (GMT+10).

Scenario 1 - Los Angeles

Your personal timezone preference is Los Angeles (which is currently GMT -7). You have a custom DateTime field that you want to migrate to Date. We imagine there are only two records with values for this field.

Record 1: 2023-07-28, 3 PM

How it is displayed to you: 2023-07-28, 3 PM. The GMT time: 2023-07-28, 10 PM

  • If you migrate this field to Date, Planhat's logic asks two questions:

    • "is the GMT time different from 12 AM GMT?"

    • "which direction should the DateTime be pushed?"

  • In this case, the GMT time is different from 0 (it's 10 PM GMT)

Record 2: 2023-07-28, 5 PM

How it is displayed to you: 2023-07-28, 5 PM. The GMT time: 2023-07-29, 12 AM

  • In this case, GMT time is not different from 0, so your migration will not push the value to a new Date, it will stay as 2023-07-29, 12 AM GMT. But now, the value will be displayed back to you as 2023-07-29, because our Date fields, by definition, do not "care" about timezones.

Scenario 2 - Sydney

Your personal timezone preference is Sydney (which is currently GMT +10). You have a custom DateTime field that you want to migrate to Date. We imagine there are only two records with values for this field.

Record 1: 2023-07-29, 8 AM

How it is displayed to you: 2023-07-29, 8 AM. The GMT time: 2023-07-28, 10 PM

  • If you migrate this field to Date, Planhat's logic asks two questions:

    • "is the GMT time different from 12 AM?"

    • "which direction should the DateTime be pushed?"

  • In this case, the GMT time is different from 0 (it's 08:00)

Record 2: 2023-07-29, 10 AM

How it is displayed to you: 2023-07-29, 10 AM. The GMT time: 2023-07-29, 12 AM

  • In this case, GMT time is not different from 0, so your migration will not push the value to a new Date, it will stay as 2023-07-29, 12 AM GMT. But now, the value will be displayed back to you as 2023-07-29, because our Date fields, by definition, do not "care" about timezones.

Switching from Date --> DateTime

When you switch a Date to be of type DateTime, this just means you can start adding a timestamp to Dates on this field. You will also be forced to specify a DateTime when using filters and other condition builders. For example, if you want to see "all endusers created after December 20, 2024", you will need to specify a time as well, since our created dates always come with a timestamp.

It is worth noting that this migration is also applied to any filter rules, automations, or other "condition builders". If you switch a DateTime field to Date, and push backward, then any rules referencing this field are also changed to to "Date" and pushed backward!

Where to Switch between Date and DateTime in App

Switching Field type per Field DateTime --> Date

Switching Field type per Field Date --> DateTime

Switching Field type in bulk, Using the Powertool

Did this answer your question?