Quick Base Discussions

Expand all | Collapse all

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

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

    Posted 04-18-2017 17:13


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

    Top
    Contributor
    Posted 04-18-2017 17:23
    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.


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

    Bronze
    Contributor
    Posted 04-18-2017 18:16
    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!


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

    Posted 04-18-2017 18:47
    It is not giving me the correct time. Something which should be 00:07 ends up being 12:07


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

    Posted 04-18-2017 18:47

    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



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

    Bronze
    Contributor
    Posted 04-18-2017 19:24
    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?