vADC Forum

Posts: 29
Registered: ‎10-19-2013
Accepted Solution

timezone of client to use in STM trafficscript

Hi All,

does anybody already managed to use the clients-timezone within a trafficscript rule?

i know it could be found via javascript-function, but i don't have a idea how to transport this information to STM...


Posts: 58
Registered: ‎11-29-2012

Re: timezone of client to use in STM trafficscript

One example using an external service to map the geoip information into a timezone name or ID.

$ip = request.getRemoteIP();

$lat = geo.getLatitude( $ip );

$long = geo.getLongitude( $ip );

$googlejson = http.request.get( ''.$lat.','.$long.'&timestamp=0&sensor=false' );

$googlehash = json.deserialize( $googlejson );

$timeZoneName = $googlehash['timeZoneName'];

$timeZoneId = $googlehash['timeZoneId']; "Time Zone Name: ".$timeZoneName ); "Time Zone ID: ".$timeZoneId );

*This rule will add the time it will take to look up the information form Google.

**I would read the  The Google Time Zone API - Google Maps API Web Services — Google Developers before use. You may want to get your own key.

Join the Community

Get quick and easy access to valuable resource designed to help you manage your Brocade Network.

Download FREE NVMe eBook