There are certain new features which bring a sigh of relief to developers and admins alike, which introduce something we’ve been waiting for for a long time.
A recent addition to Salesforce was the Time field, the ability to store just a time against a record, where previously we would have had to use either a date/time field or a text field for the same purpose.
These workarounds brought their own problems. Date/Time is really for storing a point in time such as when specifically something happened (e.g. a record was updated), and doesn’t suit the use case of storing just a time. Text fields don’t allow us to do any calculations or apply standard formatting against the data stored.
That’s all changed with the introduction of the Time field. Now we can store a time which isn’t Timezone specific (which Date/Time would do), and allow us to use validation rules and formulas to verify data recorded and calculate time differences, or some other business logic.
As an example, you manage shops and you want to store the weekday and weekend opening and closing times. Now you can easily report on the number of hours your shops are open during the week, without having to do any complicated text to number conversions or having to introduce code.
The time field is a new addition to the widely used Date and DateTime fields. Now you can store specific times independently from a date. Time field allows you to store time as an independent value. You can think about it as the time on a wall clock—it is that particular time where you are, regardless of what time it is somewhere else in the world. The time field comes as a separate field type, and also as a new return type for your formula fields. So, you can create a formula field that will return a time value.