Skip to Content

mvSQL Runtime Function - CLIENT()

Summary

Gets a property from the client--typically, the web browser.

Syntax

CLIENT(property)

Parameters

property

The requested property. Supported values include:

  • IPADDRESS - IPv4 or IPv6 client IP address.
  • TIMEZONE - IANA time zone name (2.5).
  • TIMEZONEOFFSET - Time zone offset in ISO format ±[hh]:[mm] (2.5).
  • LOCALE - Locale in ISO region-language format.

Required.

Returns

string

The format varies based on the given property.

Remarks

When an event is executed by the background service, client information is not available. The CLIENT() function will not return meaningful results.

IANA time zones are different than Windows time zones. There is no direct mapping between the two.

In Vinyl 2.4 and previous, the time zone name will return the an empty string for some clients. In particular, Internet Explorer 11 does not supply the time zone name.

In Vinyl 2.5 and above, if the client's time zone cannot be determined, the Vinyl application server's time zone will be returned.

It's not possible to map from a time zone offset to a time zone name.

Examples

IP Address

CLIENT(IPADDRESS)

Returns 192.0.2.222 (IPv4) or 2001:db8:85a3:8d3:1319:8a2e:370:7348 (IPv6).

Time Zone

CLIENT(TIMEZONE)

Returns America/New_York

Time Zone Offset

CLIENT(TIMEZONEOFFSET)

Returns -04:00

Locale

CLIENT(LOCALE)

Returns en-US