Include UTC offset for site in API Similar to WebUI #2053

Closed
opened 2025-12-29 17:21:49 +01:00 by adam · 1 comment
Owner

Originally created by @bdlamprecht on GitHub (Oct 8, 2018).

Environment

  • Python version: 3.6
  • NetBox version: 2.4.5

Proposed Functionality

When looking at the details of a site in the WebUI. the Time Zone is listed at both with a name and
a UTC offset. However, when the site details are gathered from the API, only the name of the time_zone is shown.

Use Case

As an example, the screenshot below is from the WebUI for a specific site:

image

The API (via Swagger) for the same site shows only the following:

image

This FR is to simply expose the UTC offset in the API as well.

Database Changes

None.

External Dependencies

None.

Originally created by @bdlamprecht on GitHub (Oct 8, 2018). ### Environment * Python version: 3.6 * NetBox version: 2.4.5 ### Proposed Functionality When looking at the details of a site in the WebUI. the `Time Zone` is listed at both with a name **and** a UTC offset. However, when the site details are gathered from the API, _only_ the name of the `time_zone` is shown. ### Use Case As an example, the screenshot below is from the WebUI for a specific site: ![image](https://user-images.githubusercontent.com/7783306/46624906-57924b80-caef-11e8-8b0d-3bd8ddc7c944.png) The API (via Swagger) for the same site shows only the following: ![image](https://user-images.githubusercontent.com/7783306/46625060-cbccef00-caef-11e8-8b1f-465c560273ef.png) This FR is to simply expose the UTC offset in the API as well. ### Database Changes None. ### External Dependencies None.
adam closed this issue 2025-12-29 17:21:49 +01:00
Author
Owner

@jeremystretch commented on GitHub (Oct 10, 2018):

We need to keep the API structure clean and predictable. Adding metadata to a field would complicate the effort needed to process it. The value of the time zone field is a pytz time zone, and the client can easily determine the offset locally by invoking the pytz library.

@jeremystretch commented on GitHub (Oct 10, 2018): We need to keep the API structure clean and predictable. Adding metadata to a field would complicate the effort needed to process it. The value of the time zone field is a [pytz](https://pypi.org/project/pytz/) time zone, and the client can easily determine the offset locally by invoking the pytz library.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2053