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
Derek Bennett 5Derek Bennett 5 

Time Zone Field/Area Codes

Hey Everyone,

I created a field that displays the time zone based on the phone area code, but the issue I'm having is that area codes are displayed in the wrong time zones. For example when I enter a New York Time zone it displays "Pacific Time" although the area code is listed under eastern. Here's my code:

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



if( CONTAINS 

("206:209:213:236:250:253:310:323:341:360:369:408:415:424:425:442:458:503:509:510:520:530:541:559:563:564:604:619:626:627:628:650:657:661:669:702:707:714:747:752:760:764:775:778:805:818:831:858:867:909:916:925:935:949:951:971:", left(SUBSTITUTE( Phone , "(", ""),3)),"Pacific", 


if( 

CONTAINS("208:303:306:307:308:385:403:406:432:435:480:505:575:587:602:604:623:639:701:719:720:780:801:915:928:957:970:", left(SUBSTITUTE( Phone , "(", ""),3)),"Mountain", 


if( 

CONTAINS 

("204:205:210:214:217:218:224:225:228:251:254:256:262:270:274:281:306:308:309:312:314:316:317:318:319:320:325:327:331:334:337:361:364:402:405:409:414:417:430:431:432:447:464:469:479:501:504:507:512:515:534:557:563:573:580:601:605:606:608:612:615:618:620:630:636:639:641:651:659:660:662:682:701:708:712:713:715:730:731:737:763:779:785:806:807:812:815:816:817:830:832:847:850:870:872:901:903:913:915:918:920:931:936:938:940:952:956:972:975:979:985", left(SUBSTITUTE( Phone , "(", ""),3)),"Central", 


if( 

CONTAINS 

("201:202:207:212:215:216:219:226:227:229:231:234:239:240:242:248:249:252:260:267:269:272:276:278:280:283:289:301:302:304:305:313:315:321:330:331:336:339:343:345:347:351:352:365:380:386:401:404:407:410:412:413:416:418:419:423:434:437:438:440:443:445:475:478:484:502:508:513:514::516:517:518:519:540:551:561:567:570:571:574:579:581:582:585:586:603:606:607:609:610:613:614:616:617:631:646:647:649:667:678:679:681:689:703:704:705:706:716:717:718:724:727:732:734:740:754:757:762:765:770:772:774:781:786:802:803:804:807:810:813:814:819:828:835:843:845:848:850:856:857:859:860:862:863:864:865:873:876:878:904:905:906:908:910:912:914:917:919:927:937:941:947:954:959:973:978:980:984:989:", left(SUBSTITUTE( Phone , "(", ""),3)),"Eastern", 


if( 

CONTAINS("246:268:284:340:441:473:664:721:758:767:784:787:809:849:868:869:939",LEFT(SUBSTITUTE(Phone,"(",""),3)),"Atlantic", 

if( 

CONTAINS("684",LEFT(SUBSTITUTE(Phone,"(",""),3)),"American Samoa", 

if( 

CONTAINS("808",LEFT(SUBSTITUTE(Phone,"(",""),3)),"Hawaii", 

if( 

CONTAINS("670:671",LEFT(SUBSTITUTE(Phone,"(",""),3)),"Guam", 

if( 

CONTAINS("800:877",LEFT(SUBSTITUTE(Phone,"(",""),3)),"Toll Free","Other" 


))))))))))
Tad Aalgaard 3Tad Aalgaard 3
I tried your forumula using 212 and it worked fine and displayed Eastern.