How can I create the HH:MM between a time field and a date/time field?

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • In Progress
Photo of Casameira Reyes

Casameira Reyes

  • 380 Points 250 badge 2x thumb

Posted 2 years ago

  • 0
  • 1
Photo of Matthew Neil

Matthew Neil

  • 31,438 Points 20k badge 2x thumb
ToTimeOfDay (Date/Time t)

Description: Date/Time fields display the date and time. This function returns the TimeOfDay on which the Date/Time t falls in the local time zone.

Example: ToTimeOfDay([Last Modified])

Hope that helps, but I'm not sure I understand your question all the way.
Oh, I think I understand what you are trying to do...

If you want to know the difference in hours and minutes between 2 separate fields, a date/time and just a time (time of day) field, you might do something like this:

Create a formula duration field and make this the formula (you can reverse the order):

ToTimeOfDay([Date/Time Field])-[Time of Day Field]

Then, set your duration field properties to HH:MM. 

That should do it my friend!
(Edited)
Photo of Casameira Reyes

Casameira Reyes

  • 380 Points 250 badge 2x thumb

I'm not getting the correct duration. If I put in time of accident of 1:30 pm - Time stamp of 1:37 pm, I'm getting 12:07 am instead of 00:07

Photo of Casameira Reyes

Casameira Reyes

  • 380 Points 250 badge 2x thumb
It is not giving me the correct time. Something which should be 00:07 ends up being 12:07
If it is giving you an am or pm in your formula field, you might have the wrong field type. Can you confirm that the formula field is a formula - duration field type?