> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# NSTimeZoneAgent

> TimeZone maintenance.

TimeZone maintenance.

## Constructors

### NSTimeZoneAgent()

```crmscript theme={null}
NSTimeZoneAgent
```

TimeZone maintenance.

## Methods

## CheckNewTimeZoneDataAvailable()

Checks to see if new timezone data is available

```crmscript theme={null}
Bool CheckNewTimeZoneDataAvailable()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool)

**Example:**

```crmscript theme={null}
NSTimeZoneAgent agent;
Bool res = agent.CheckNewTimeZoneDataAvailable();
```

## DeleteTimeZones()

Deletes all time zone data (locations and rules) from the database

```crmscript theme={null}
Void DeleteTimeZones()
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## GetBaseTimeZoneId()

Gets the base timezone ID.

```crmscript theme={null}
Integer GetBaseTimeZoneId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer)

**Example:**

```crmscript theme={null}
NSTimeZoneAgent agent;
Integer res = agent.GetBaseTimeZoneId();
```

## GetDefaultTimeZonePreference()

Returns the ID of the default timezone preference with deflevel system wide

```crmscript theme={null}
Integer GetDefaultTimeZonePreference()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer)

**Example:**

```crmscript theme={null}
NSTimeZoneAgent agent;
Integer res = agent.GetDefaultTimeZonePreference();
```

## InitializeTimeZoneData()

Initializes the NSTimeZoneData

```crmscript theme={null}
NSTimeZoneData[] InitializeTimeZoneData()
```

**Returns:** [CRMScript.NetServer.NSTimeZoneData](CRMScript.NetServer.NSTimeZoneData)\[]

## SetActiveTimeZoneRow(Integer,Bool)

Sets active state of singe row in the TZLocation table

```crmscript theme={null}
Void SetActiveTimeZoneRow(Integer id, Bool active)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## SetActiveTimeZonesByFilter(String,Bool)

Toggles active state of a single row in the TZLocation table

```crmscript theme={null}
Void SetActiveTimeZonesByFilter(String filter, Bool active)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## SetBaseTimeZoneId(Integer)

Sets the base timezone ID.

```crmscript theme={null}
Bool SetBaseTimeZoneId(Integer timezoneId)
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool)

**Example:**

```crmscript theme={null}
NSTimeZoneAgent agent;
Integer timezoneId;
Bool res = agent.SetBaseTimeZoneId(timezoneId);
```

## TimeOfLastTimeZoneUpdate()

Gets the time time zone data was last updated

```crmscript theme={null}
DateTime TimeOfLastTimeZoneUpdate()
```

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime)

**Example:**

```crmscript theme={null}
NSTimeZoneAgent agent;
DateTime res = agent.TimeOfLastTimeZoneUpdate();
```

## ToggleActiveTimeZoneRow(Integer)

Toggles active state of a single row in the TZLocation table

```crmscript theme={null}
Void ToggleActiveTimeZoneRow(Integer id)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## UpdateTimeZoneData()

Retrieves time zone data from the SuperOffice server and update TimeZone data in the database

```crmscript theme={null}
Bool UpdateTimeZoneData()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool)

**Example:**

```crmscript theme={null}
NSTimeZoneAgent agent;
Bool res = agent.UpdateTimeZoneData();
```


## Related topics

- [SuperOffice.WebApi.Agents.TimeZoneAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.TimeZoneAgent.md)
- [SuperOffice.WebApi.Agents.ITimeZoneAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.ITimeZoneAgent.md)
- [Delete Time Zones](/en/api/reference/restful/agent/timezone_agent/delete-time-zones.md)
- [Time zones](/en/localization/learn/time-zones.md)
- [TimeZones](/en/api/archive-providers/reference/timezones.md)
- [Time Of Last Time Zone Update](/en/api/reference/restful/agent/timezone_agent/time-of-last-time-zone-update.md)
