function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RupaliJRupaliJ 

How to get Contact's local time?

Hi,

 

I want to access the current time of the Contact based on the location/address. Please suggest some solution to do this.

 

Thanks.

kkr.devkkr.dev

I have made a function, it's very limited, since it takes into account the Current time zone, and calculates the result based on that, so if a user from a differeant TZ of me, will open the field,, he will see a wrong local time for that account.
Yes, this can be updated, and to calculate based on user names, and do a more complicated calculation (if anyone wants to take that initiative, go ahead).
but for now, I made a date/time field, visible only to me.

feel free to update this formula as you need

IF(CONTAINS("india:sri lanka:pakistan", LOWER(BillingCountry) ),NOW()+1/24*2.5, 
IF(CONTAINS("vietnam", LOWER(BillingCountry) ),NOW()+1/24*6, 
IF(CONTAINS("thailand", LOWER(BillingCountry) ),NOW()+1/24*5, 
IF(CONTAINS("australia", LOWER(BillingCountry) ),NOW()+1/24*8, 
IF(CONTAINS("new zealand", LOWER(BillingCountry) ),NOW()+1/24*9, 
NOW())))))