Extract Time from Date/Time

Viewing 3 reply threads
  • Author
    Posts
  • October 9, 2018 at 11:24 AM #30973

    Chris Parker
    Participant

    Hi,

    I’ve got an ETDZ (Estimated time of Departure in Zulu) field which is a Date/Time field. I also have an Departure Time Zone field (number) which I add to get ETDL (Estimated Time of Departure (Local time).

    ETDZ: 11 Oct 2018 12:00
    ETDL: 11 Oct 2018 13:00

    The ETDL field displays the Date and Time which takes up a lot of space on the form. I only want to display the time part of it. How can I do this?

    Thanks in advance,
    Chris

    October 9, 2018 at 11:29 AM #30974

    Brendan
    Keymaster

    Hi Chris,

    To remove the Date part you’d have to switch to a Time field instead. But then the date part would be set to January 1, 1970 for all new records.

    Thanks!

    Brendan

    October 9, 2018 at 1:24 PM #30975

    Chris Parker
    Participant

    Thanks Brendan.

    Can I calculate the ETDL from ETDZ + time zone and get a result as a time field? Or would I have to change ETDZ to a time field for this to work?

    October 9, 2018 at 5:19 PM #30976

    Brendan
    Keymaster

    You can use the DATEADD() function to add a certain amount to another date/time value. I suppose you could add or subtract x number of hours to account for time zones.

    You could also use the DATE() function to use a pattern to return just the time:

    DATE(ETDZ; "HH:mm") and then set the Result Type to Text on the Calculation field’s formula.

    That might get you what you want.

Viewing 3 reply threads

You must be logged in to reply to this topic.