0

The only time API field in the Activity object is the ActivityDateTime. If I want to capture the Start Time ina formula. I don't see a solution. the following formula is pulling the end time. So it Start =2:30 and end time is 3:30, it displays 3:30:

IF( OR( VALUE( MID( TEXT( ActivityDateTime - (1/24) ), 12, 2 ) ) = 0, VALUE( MID( TEXT( ActivityDateTime - (1/24) ), 12, 2 ) ) = 12 ), "12", TEXT( VALUE( MID( TEXT( ActivityDateTime - (1/24) ), 12, 2 ) ) - IF( VALUE( MID( TEXT( ActivityDateTime - (1/24)), 12, 2 ) ) < 12, 0, 12 ) ) ) & ":" & MID( TEXT( ActivityDateTime - (1/24) ), 15, 2 ) & " " &IF(VALUE( MID( TEXT( ActivityDateTime - (1/24) ), 12, 2 ) ) < 12, "AM", "PM" )
1
  • Just a guess, but I think I know why it's an hour different. I could have sworn this was working before as it is. I just read someplace that the (1/24). The 1 represents the Daylight Savings Time (DST). I'm not sure what the # is for Eastern Stanard Time. – Robert Wynter Nov 20 '20 at 21:22
0

The function you would want to use is TIMEVALUE. And you can use ActivityDateTime or StartDateTime if you are using Events.

Examples:
TIMEVALUE(StartDateTime) displays a time value based on the value of the Start DateTime field.

TIMEVALUE("17:30:45.125") returns 5:30 PM.

Tips:
The displayed value is based on the organization’s Locale settings. Don’t use TIMEVALUE on a time field. A time field’s value is already in time format. For example, for a time field with API name timefield__c, TIMEVALUE(timefield__c) doesn’t do anything.

2
  • Hi John, thank you for your assistance. I tried TEXT( TIMEVALUE(StartDateTime)) on the Activity Object and received the error: Error: Field StartDateTime does not exist. Check spelling. – Robert Wynter Nov 20 '20 at 20:33
  • That's interesting. The Event specific fields aren't available in Activity Formulas. You could create a custom Time field on Activity and then populate it via Workflow/PB/Flow. Because you specify Event vs Task on automation, the StartDateTime becomes available in the formula builder. – John Schneider Nov 20 '20 at 23:13
0

once I changed the (1/24) to (5/24) it was fixed to EST

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.