Hello Sir,
How can we identity the calling user timezone?
Regards,
Amit
We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics
Getting User TimeZone
-
- Posts: 53
- Joined: Sun Feb 15, 2009 11:42 pm
- Contact:
Using IVR code to create a database
Hi,
You would be able to do this by writing an IVR code that creates a database that does a lookup of the time zone of the user based on the user's area code.
Regards,
Plum Support
You would be able to do this by writing an IVR code that creates a database that does a lookup of the time zone of the user based on the user's area code.
Regards,
Plum Support
Plum Support
http://www.plumvoice.com
http://www.plumvoice.com
getting a caller time zone
Hello
Here is the php code to find the local time where the caller is calling from. In N. America. Any areacodes that are not listed are set to Central time. It's approximate and rough0-and-ready. But it works for most of the continent. Please publish errors and updates here so we can all share..
John
Here is the php code to find the local time where the caller is calling from. In N. America. Any areacodes that are not listed are set to Central time. It's approximate and rough0-and-ready. But it works for most of the continent. Please publish errors and updates here so we can all share..
John
Code: Select all
function AreaCodeLocalTime ($AreaCode){
// this function returns a timestamp suitable for updating a mysql database timestamp field
// with the current time for the originating area code/ Built for IVR programs.
// http://en.wikipedia.org/wiki/Zoneinfo basic information
// http://en.wikipedia.org/wiki/Daylight_saving more than you wanted to know
// http://www.greatdata.com/pdf/ac-timezone.pdf one N. America table
// http://www.asksam.com/ebooks/releases.asp?file=area_codes.ask N. America area code -> time zone
//
// http://www.bennetyee.org/ucsd-pages/area.html this is the one I used...
// area code to offset to timezone in a separate program to generate this statement
// to represent the area code as an index to tne array $ac.
// the putenv approach is from http://support.modwest.com/kb.phtml?qid=258 (merci beaucoup)
$ac = array(52=>'Central',201=>'Eastern',202=>'Eastern',203=>'Eastern',204=>'Central',205=>'Central',206=>'Pacific',207=>'Eastern',208=>'Mountain',209=>'Pacific',210=>'Central',211=>'Central',212=>'Eastern',213=>'Pacific',214=>'Central',215=>'Eastern',216=>'Eastern',217=>'Central',218=>'Central',219=>'Central',224=>'Central',225=>'Central',226=>'Eastern',228=>'Central',229=>'Eastern',231=>'Eastern',234=>'Eastern',236=>'Eastern',239=>'Eastern',240=>'Eastern',242=>'Eastern',246=>'Central',248=>'Eastern',250=>'Pacific',251=>'Central',252=>'Eastern',253=>'Pacific',254=>'Central',256=>'Central',260=>'Eastern',262=>'Central',264=>'Central',267=>'Eastern',268=>'Central',269=>'Eastern',270=>'Central',276=>'Eastern',278=>'Eastern',281=>'Central',283=>'Eastern',284=>'Central',289=>'Eastern',301=>'Eastern',302=>'Eastern',303=>'Mountain',304=>'Eastern',305=>'Eastern',306=>'Central',307=>'Mountain',308=>'Central',309=>'Central',310=>'Pacific',311=>'Central',312=>'Central',313=>'Eastern',314=>'Central',315=>'Eastern',316=>'Central',317=>'Eastern',318=>'Central',319=>'Central',320=>'Central',321=>'Eastern',323=>'Pacific',325=>'Central',330=>'Eastern',331=>'Central',334=>'Central',336=>'Eastern',337=>'Central',339=>'Eastern',340=>'Central',341=>'Pacific',345=>'Eastern',347=>'Eastern',351=>'Eastern',352=>'Eastern',360=>'Pacific',361=>'Central',369=>'Pacific',380=>'Eastern',385=>'Mountain',386=>'Eastern',401=>'Eastern',402=>'Central',403=>'Mountain',404=>'Eastern',405=>'Central',406=>'Mountain',407=>'Eastern',408=>'Pacific',409=>'Central',410=>'Eastern',411=>'Central',412=>'Eastern',413=>'Eastern',414=>'Central',415=>'Pacific',416=>'Eastern',417=>'Central',418=>'Eastern',419=>'Eastern',423=>'Eastern',424=>'Pacific',425=>'Pacific',430=>'Central',432=>'Mountain',434=>'Eastern',435=>'Mountain',438=>'Eastern',440=>'Eastern',441=>'Central',442=>'Pacific',443=>'Eastern',450=>'Eastern',456=>'Central',464=>'Central',469=>'Central',470=>'Eastern',473=>'Central',475=>'Eastern',478=>'Eastern',479=>'Central',480=>'Mountain',484=>'Eastern',500=>'Central',501=>'Central',502=>'Eastern',503=>'Pacific',504=>'Central',505=>'Mountain',506=>'Central',507=>'Central',508=>'Eastern',509=>'Pacific',510=>'Pacific',511=>'Central',512=>'Central',513=>'Eastern',514=>'Eastern',515=>'Central',516=>'Eastern',517=>'Eastern',518=>'Eastern',519=>'Eastern',520=>'Mountain',530=>'Pacific',540=>'Eastern',541=>'Pacific',551=>'Eastern',555=>'Central',557=>'Central',559=>'Pacific',561=>'Eastern',562=>'Pacific',563=>'Central',564=>'Pacific',567=>'Eastern',570=>'Eastern',571=>'Eastern',573=>'Central',574=>'Eastern',575=>'Mountain',580=>'Central',585=>'Eastern',586=>'Eastern',600=>'Central',601=>'Central',602=>'Mountain',603=>'Eastern',604=>'Pacific',605=>'Central',606=>'Eastern',607=>'Eastern',608=>'Central',609=>'Eastern',610=>'Eastern',611=>'Central',612=>'Central',613=>'Eastern',614=>'Eastern',615=>'Central',616=>'Eastern',617=>'Eastern',618=>'Central',619=>'Pacific',620=>'Central',623=>'Mountain',626=>'Pacific',627=>'Pacific',628=>'Pacific',630=>'Central',631=>'Eastern',636=>'Central',641=>'Central',646=>'Eastern',647=>'Eastern',649=>'Eastern',650=>'Pacific',651=>'Central',660=>'Central',661=>'Pacific',662=>'Central',664=>'Central',669=>'Pacific',670=>'Central',671=>'Central',678=>'Eastern',679=>'Eastern',682=>'Central',684=>'Central',689=>'Eastern',700=>'Central',701=>'Central',702=>'Pacific',703=>'Eastern',704=>'Eastern',705=>'Eastern',706=>'Eastern',707=>'Pacific',708=>'Central',709=>'Central',710=>'Central',711=>'Central',712=>'Central',713=>'Central',714=>'Pacific',715=>'Central',716=>'Eastern',717=>'Eastern',718=>'Eastern',719=>'Mountain',720=>'Mountain',724=>'Eastern',727=>'Eastern',731=>'Central',732=>'Eastern',734=>'Eastern',737=>'Central',740=>'Eastern',747=>'Pacific',754=>'Eastern',757=>'Eastern',758=>'Central',760=>'Pacific',762=>'Eastern',763=>'Central',764=>'Pacific',765=>'Eastern',767=>'Central',769=>'Central',770=>'Eastern',772=>'Eastern',773=>'Central',774=>'Eastern',775=>'Pacific',778=>'Pacific',779=>'Central',780=>'Mountain',781=>'Eastern',784=>'Central',785=>'Central',786=>'Eastern',787=>'Central',800=>'Central',801=>'Mountain',802=>'Eastern',803=>'Eastern',804=>'Eastern',805=>'Pacific',806=>'Central',807=>'Eastern',808=>'Central',809=>'Central',810=>'Eastern',811=>'Central',812=>'Central',813=>'Eastern',814=>'Eastern',815=>'Central',816=>'Central',817=>'Central',818=>'Pacific',819=>'Eastern',822=>'Central',828=>'Eastern',829=>'Central',830=>'Central',831=>'Pacific',832=>'Central',833=>'Central',835=>'Eastern',843=>'Eastern',844=>'Central',845=>'Eastern',847=>'Central',848=>'Eastern',850=>'Central',855=>'Central',856=>'Eastern',857=>'Eastern',858=>'Pacific',859=>'Eastern',860=>'Eastern',862=>'Eastern',863=>'Eastern',864=>'Eastern',865=>'Eastern',866=>'Central',867=>'Eastern',868=>'Central',869=>'Central',870=>'Central',872=>'Central',876=>'Eastern',877=>'Central',878=>'Eastern',880=>'Central',881=>'Central',882=>'Central',888=>'Central',898=>'Central',900=>'Central',901=>'Central',902=>'Central',903=>'Central',904=>'Eastern',905=>'Eastern',906=>'Central',907=>'Central',908=>'Eastern',909=>'Pacific',910=>'Eastern',911=>'Central',912=>'Eastern',913=>'Central',914=>'Eastern',915=>'Mountain',916=>'Pacific',917=>'Eastern',918=>'Central',919=>'Eastern',920=>'Central',925=>'Pacific',927=>'Eastern',928=>'Mountain',931=>'Central',935=>'Pacific',936=>'Central',937=>'Eastern',939=>'Central',940=>'Central',941=>'Eastern',947=>'Eastern',949=>'Pacific',951=>'Pacific',952=>'Central',954=>'Eastern',956=>'Central',957=>'Mountain',959=>'Eastern',970=>'Mountain',971=>'Pacific',972=>'Central',973=>'Eastern',975=>'Central',976=>'Central',978=>'Eastern',979=>'Central',980=>'Eastern',984=>'Eastern',985=>'Central',989=>'Eastern',999=>'Central');
$tz = $ac[$AreaCode];
if (!$tz){
$tz = "Central";
}
putenv("TZ=US/".$tz);
return date("Y-m-d")." ".date("H:i:s");
}
John Brohan National Instruments LabVIEW expert in Montreal
Traders Micro "We connect all sorts of things to computers"
telemedicine applications
www.woundfollowup.com
Traders Micro "We connect all sorts of things to computers"
telemedicine applications
www.woundfollowup.com
caller time zone code
Thanks for the contribution, John!
Regards,
Plum Support
Regards,
Plum Support
Plum Support
http://www.plumvoice.com
http://www.plumvoice.com