Help

Re: Update date and time based and on another date and time but no later than 10:30PM PST

54 0
cancel
Showing results for 
Search instead for 
Did you mean: 
airballer86
6 - Interface Innovator
6 - Interface Innovator

Hi, I'm trying to update one date and time field {end date} based and on another date and time field {start date}. The catch is the {end date} cannot be later than 10:30PM PST (2024-09-01T10:29:59-08:00).

 

5 Replies 5

Does this look right?  I'm not sure how to handle daylight savings here though

Screenshot 2024-09-14 at 5.00.23 PM.png

IF(
  OR(
    DATETIME_FORMAT(
      {Actual End in PDT},
      'HH'
    ) > 22,
    AND(
      DATETIME_FORMAT(
        {Actual End in PDT},
        'HH'
      ) = 22,
      DATETIME_FORMAT(
        {Actual End in PDT},
        'mm'
      ) > 30
    )
  ),
  DATEADD(
  DATETIME_PARSE(
    DATETIME_FORMAT(
      Start,
      'DD MM YYYY'
    ),
    "DD MM YYYY"
  ),
  22.5 + 7,
  'hours'
),
DATEADD(Start, {Hours to add}, 'hours')
)

Link to base

@TheTimeSavingCo Thank you for the formula. The formula works, however it doesn't keep the end time at 10:30 PM or earlier. Is there a way to add that constraint? 

email_nolaterthan.jpg

 

thanks, 

Interesting!  Could you provide a screenshot of it not working?  The screenshot in your post doesn't show any end times past 10:30pm, so I don't know how to replicate the issue you're facing!

@TheTimeSavingCo the first campaign has an end time of 3:00 AM the following day. It should have the max time of 10:30pm the same day. If I’m understanding your liogic correctly 

Ah, I see!  I made it handle up to 2359 of the same day, and so if the end time is the next day it just displays that value instead.  Hmm, to handle this we'd need a latest time that we'd want it to display 2230 for.  For example, if the end time is the next day at 0700, would we show 0700 of the next day or 2230 of the previous day?