Forum Discussion

CasameiraReyes's avatar
CasameiraReyes
Qrew Cadet
8 years ago

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

  • MCFNeil's avatar
    MCFNeil
    Qrew Captain
    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!
    • CasameiraReyes's avatar
      CasameiraReyes
      Qrew Cadet
      It is not giving me the correct time. Something which should be 00:07 ends up being 12:07
    • CasameiraReyes's avatar
      CasameiraReyes
      Qrew Cadet

      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

    • Eric_J_Hansen's avatar
      Eric_J_Hansen
      Qrew Cadet
      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?