> ## 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.

# Time

> A class for representing time as objects. Time is a complex data type representing the time of the day in hours, minutes, and seconds. The default value is now. ISO 8601 uses the 24-hour clock system. Format: hh:mm:ss

A class for representing time as objects. Time is a complex data type representing the time of the day in hours, minutes, and seconds. The default value is now. ISO 8601 uses the 24-hour clock system. Format: hh:mm:ss

## Constructors

### Time()

```crmscript theme={null}
Time Time()
```

Default constructor.

### Time(Time)

```crmscript theme={null}
Time Time(Time value)
```

Pass a value to copy into a new object.

### Time(String)

```crmscript theme={null}
Time Time(String value)
```

Pass a String containing a timestamp on format HH:MM:SS. The constructor will parse the text and create a Time object.

## Methods

## toString()

Converts a Time value to its string representation.

One of the most frequently used methods, typically when you are going to output something.

```crmscript theme={null}
String toString()
```

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

**Example:**

```crmscript theme={null}
Time t;
String s = t.toString();
```

## setHour(Integer)

Overwrites the current time and sets hours to the given number \[0-23].

```crmscript theme={null}
Void setHour(Integer hour)
```

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

**Example:**

```crmscript theme={null}
Time t;
t.setHour(14);
```

## setMin(Integer)

Overwrites the current time and sets minutes to the given number \[0-59].

```crmscript theme={null}
Void setMin(Integer min)
```

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

**Example:**

```crmscript theme={null}
Time t;
t.setMin(37);
```

## setSec(Integer)

Overwrites the current time and sets seconds to the given number \[0-59].

```crmscript theme={null}
Void setSec(Integer sec)
```

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

**Example:**

```crmscript theme={null}
Time t;
t.setSec(0);
```

## getHour()

Returns the hour portion of the time as an Integer.

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

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

**Example:**

```crmscript theme={null}
Time t;
print(t.getHour().toString());
```

## getMin()

Returns the minutes portion of the time as an Integer.

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

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

**Example:**

```crmscript theme={null}
Time t;
print(t.getMin().toString());
```

## getSec()

Returns the seconds portion of the time as an Integer.

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

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

**Example:**

```crmscript theme={null}
Time t;
print(t.getSec().toString());
```

## isNull()

Returns true if it has no value and false if it does.

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

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

<Note>
  A NULL/NUL/NIL Time is different from zero, in that it is conceptually without a value.
</Note>

**Example:**

```crmscript theme={null}
Time t;
print(t.isNull().toString());
```


## Related topics

- [time](/en/api/mdo-providers/reference/time.md)
- [Time data type](/en/automation/crmscript/datatypes/time-type.md)
- [Time zones](/en/localization/learn/time-zones.md)
- [Time Of Last Time Zone Update](/en/api/reference/restful/agent/timezone_agent/time-of-last-time-zone-update.md)
- [TimeZones](/en/api/archive-providers/reference/timezones.md)
- [TimeZone](/en/automation/crmscript/reference/CRMScript.Native.TimeZone.md)
