---
title: client.geo.utc_offset
summary: null
url: >-
  https://www.fastly.com/documentation/reference/vcl/variables/geolocation/client-geo-utc-offset
---


Time zone offset from coordinated universal time (UTC) for
`client.geo.city`.

Values may be negative. Values are given as base-10 numbers of three or four digits
in the form `(-)HHMM` or `(-)HMM` where `H` is hours and `M` is minutes.
For example, -230 would be offset of minus two hours and thirty minutes from UTC.

This may be formatted to an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) four-digit
form `(-)HHMM` by VCL:

```vcl
sub client_geo_offset_iso8601 STRING {
  return regsub(client.geo.utc_offset, "^(-?)(...)$", "\10\2");
}
```

The special value 0 is used to indicate absent data,
and the special value 9999 to indicate an invalid region.

Not all timezone offsets are on the hour.
For example, in St. John's, Newfoundland, `client.geo.utc_offset` may be
-230 or -330 (depending on daylight savings time).

The following subroutine produces a value in units of hours:

```vcl
sub client_geo_offset_by_hour FLOAT {
  declare local var.n FLOAT;

  set var.n = client.geo.utc_offset;
  set var.n %= 100;
  set var.n /= 60; # minutes
  set var.n += std.atoi(regsub(client.geo.utc_offset, "..$", "")); # truncate

  return var.n;
}
```

Here, increments of 0.5 correspond to half hours.
For example, an offset of 930 will produce a floating point value of 9.5.
