– When using a Date Picker control to select a date and store it in Dataverse, the format of the stored content depends on whether the Dataverse column has been defined as ‘Date only’ or as ‘Date and time’
As you might expect, a ‘Date only’ column purely stores the date. For example, today’s date would be stored in US format: 11/05/2023
With a ‘Date and Time’ column, because a Data Picker control doesn’t have a time element, the default time of midnight, ie the start of the day, is appended to the date giving: 11/05/2023 00:00 AM
Customising the Date and Time Selection
There could be a reason that requires a different default time than midnight
Consider the example of arranging a delivery date and time, as in the example below. A ‘Date and time’ column called Deadline in a Dataverse table called Delivery that captures the latest an item should be delivered
The column is populated by concatenating and patching the selections made in two controls, a Date Picker and a Radio Button
Add the following table formula to the Items property of the Radio control to define the display text and value for each button
Selecting today’s date and the option of delivery before 1pm, patches the following to Dataverse
11/05/2023 13:00 AM
Interestingly, you might think that using this same approach with a ‘Date only’ column would fail but it doesn’t and the date and time is patched in just the same way