Jul
15

Time Zones for Leads & Contacts

Author // Brent Mellow

Time Zones for Salesforce.comIf you call on clients nationally, you may have figured out that it often makes sense to make your sales calls starting in the Eastern time zones and working towards the West. For example, if you live in the Central time zone and start your business day at 8am CT, you may not want to call on clients in the Pacific time zone first thing in the morning (6am). Furthermore, you may want to start your calling on the Eastern time zone because they will be at lunch before you know it. Consequently, it is very helpful to be able to sort your Leads or Contact calls by time zone. There are a number of ways of achieving this, including some plug-ins for the Firefox browser, but I prefer a solution native to salesforce.com that doesn't require me to be on a specific computer and using a specific browser. Consequently, I created this Time Zone custom formula field to identify time zones.

The formula is based on the area code for the standard Phone field (same on both Leads and Contacts so you should be able to create this field on either object using the same formula). You could also substitute the mobile phone, but many people don't change these when they move. I for example, moved from Texas (Central) to Colorado (Mountain) but still use my Dallas-based cell phone number. Consequently, even if you call the mobile number, basing the selecting of who to call from time zone off the office phone isn't a bad idea.

Click Here for Formula

I should note that less than 5% of the area codes are split among 2 time zones, so I have coded the time zone to the LATER of the two. You could also create a similar formula based on State/Province vs. area code, but be aware, there are more states that split time zones than area codes that split time zones. Finally, I only addressed Pacific, Mountain, Central and Eastern time zones. Others are grouped under "Other", but you could expand the formula as you like. Special thanks to my daughter Hannah for reading the area codes out loud while I typed them into the formula :)

Have any questions, comments or another way of tackling this problem? Feel free to add a comment.

Comments  

 
0 #11 Michael B 2011-12-01 13:55
Thanks for doing setting that up. Very helpful! *Also, note 401 is missing as well from Eastern..
Quote
 
 
0 #10 Annie 2011-06-17 18:14
Thank You!

This formula is just what I was looking for.

Annie
Quote
 
 
0 #9 cesar 2010-12-28 09:39
Part4:

if(
CONTAINS("907", left(SUBSTITUTE ( Phone , "(", ""),3)),"E-Alaska",

if(
CONTAINS("808", left(SUBSTITUTE ( Phone , "(", ""),3)),"F-Hawaii",

if(
CONTAINS("800:877",LEFT(SUBSTITUT E (Phone,"(",""),3)),"Toll Free","Other"

))))))))
Quote
 
 
0 #8 cesar 2010-12-28 09:38
Part 3:


if(
CONTAINS("201:202:203:207:212:215:216:219:226:229:231:234:239:240:248:252:2 67:269:276:289: 301:302:304:305:313:315:321:330:336:339:345:347:351:352:386:404:407:410:412:416:418:419:434:438:440:443:450:470:475:47 8:484:502:508:5 13:514:516:517:518:519:540:551:561:567:570:571:585:586:603:606:607:609:610:613:614:616:617:631:646:647:649:67 8:703:704:705:706:716:717:718:724:727:732:734:740:754:757:7 70:772:774:781:786:802:803:804:810:812:813:814:819:828:835:843:845:848:856:85 7:859:860:862:8 63:864:865:876:87 8:904:905:908:9 10:912:914:917:919:937:941:947:954:959:97 3:978:980", left(SUBSTITUTE ( Phone , "(", ""),3)),"A-Eastern",
Quote
 
 
0 #7 cesar 2010-12-28 09:37
Part 2:

if(
CONTAINS("204:205:210:214:217:218:224:225:228:2 51:254:256:262:27 0:281:306:308:309:312:314:316:318:319:320:325:334:337:361:402:405:409:414:417:430:432:469:479:501:504:507:512:515:563:573:580:601:605:608:612:615:618:620:630:636:641:651:660:662:682:70 8:712:713:715:731:763:769:773:785:806:815:816:817:830:832:847:901:903:913:915:918:920:931:936:940:952:956:9 72:979:985:", left(SUBSTITUTE ( Phone , "(", ""),3)),"B-Central",
Quote
 
 
0 #6 cesar 2010-12-28 09:36
I added HI, AK and area code 812 in addition to changing the titles of the area codes here it is in multiple parts:

Part 1:

if( ISBLANK(Phone), "--",

if( CONTAINS("206:209:213:253:310:323:360:408:415:425:503:509:510:530:559:562:604:6 19:626:650:661:702:707:714:760:775:778:8 05:818:831:858:867:909:916:925:949:951:971", left(SUBSTITUTE ( Phone , "(", ""),3)),"D-Pacific",

if(
CONTAINS("208:250:303:307:385403:406:435:480:505:520:6 02:623:719:720:780:801:928:970", left(SUBSTITUTE ( Phone , "(", ""),3)),"C-Mountain",
Quote
 
 
0 #5 cesar 2010-12-28 09:33
Hey Mr. Mellow,
Thank you very much!
Quote
 
 
0 #4 Luke C 2010-09-29 12:39
I pursued the area code route but found that my customer base, largely college students, were really prone to moving to new timezone but keeping their home area code. I had to divert to zipcodes and used Custom Settings to build a database of 2000+ 3- and 4- digit zipcode prefixes mapped to their timezones. Apex can then get value on the zip prefix key. It's hitting about 99.7% accuracy. I'm hoping to post the code (and more critically, the data file) to the Code Share when I find time.
Quote
 
 
0 #3 Fraser 2010-08-06 10:11
I've seen a similar approach but adds the time zone difference to the field message. This allows users to know the difference in time. In the snippet below (-2 hours and -1 hour)from the my timezone PST.

CASE(1,
IF( CONTAINS("(808:808-:808.:808 ", LEFT(Phone,4)), 1,0),
(PDT-2:00) Hawaii Standard Time (Pacific/Honolulu),
IF( CONTAINS("(907:907-:907.:907 ", LEFT(Phone,4)), 1,0),
(PDT-1:00) Alaska Daylight Time (America/Anchorage),
Unknown)
Quote
 
 
0 #2 Amber 2010-08-02 10:40
This formula is fantastic! I was dreading building my own version! Thanks so much for sharing!
Oh, and Hannah deserves a medal!
Quote