---
title: "DigitalTime (Generic)"
canonical: "https://docs.cuesystem.com/space/CVCGC/419364882/DigitalTime%20(Generic)"
format: markdown
---
> Macro (toc)

---

# Description

This object displays the current local time of a CUEunit. The time format can be selected from up to six options as displayed in the following figure.

![image](media://b439c513-43b6-48d3-a106-5b847fe448f2)

# Properties

|  |  |  |  |  |
| --- | --- | --- | --- | --- |
| Property Name | Data Type | Allowed Values | Default Value | Description |
| Behavior |
| Events | Boolean | True  
False | False | If True event OnTouch is enabled. If False event OnTouch is disabled. |
| Appearance |
| Align | Long | Left-Top  
Left-Middle   
Left-Bottom   
Center-Top  
Center-Middle Center-Bottom Right-Top   
Right-Middle  
Right-Bottom | Center-Middle | Horizontal and vertical align of time. |
| Font | AddressOf _Font | fntDefault16 |  | Time font. fntDefault16 is Verdana 16 pixels high. |
| Font3DEffect | Boolean | True  
False | False |  |
| FontColor | Long | Any | _COLOR_BLACK | Color of time |
| Format | Long | 1 = H:mm  
2 = HH:mm  
3 = h:mm tt   
4 = H.mm  
5 = H:mm:ss  
6 = HH:mm:ss   
7 = h:mm:ss tt  
8 = H.mm.ss | 1 | Format of time. See the figure above for more details. |

# Functions

## SetAlign

This function sets align of time. You can use meaningful BitOr combinations of the following constants as parameters

- _TEXT_ALIGNLEFT, _TEXT_ALIGNHCENTER, _TEXT_ALIGNRIGHT
- _TEXT_ALIGNTOP, _TEXT_ALIGNVCENTER, _TEXT_ALIGNBOTTOM

The function returns True on success or False if an error occurs.

#### Syntax

```visualbasic
Function SetAlign(newalign As Long) As Boolean
```

## GetAlign

This function returns the current align of time.

#### Syntax

```visualbasic
Function GetAlign() As Long
```

## SetEvents

This function enables (newevents = True) or disables (newevents = False) event OnTouch. The function returns True.

#### Syntax

```visualbasic
Function SetEvents(newevents As Boolean) As Boolean
```

## GetEvents

This function returns True (event OnTouch enabled) or False (event OnTouch disabled).

#### Syntax

```visualbasic
Function GetEvents() As Boolean
```

## SetFont

This function sets the font of time. The function returns True.

#### Syntax

```visualbasic
Function SetFont(newfont As AddressOf _Font) As Boolean
```

## GetFont

This function returns address of time font.

#### Syntax

```visualbasic
Function GetFont() As AddressOf _Font
```

## SetFont3DEffect

This function switches font 3D effect on (newfont3deffect = True) or off (newfont3deffect = False). The function returns True.

#### Syntax

```visualbasic
Function SetFont3DEffect(newfont3deffect As Boolean) As Boolean
```

## GetFont3DEffect

This function returns True (font 3D effect switched on) or False (font 3D effect switched off).

#### Syntax

```visualbasic
Function GetFont3DEffect() As Boolean
```

## SetFontColor

This function sets FontColor to newfontcolor value. The function returns True.

#### Syntax

```visualbasic
Function SetFontColor(newfontcolor As Long) As Boolean
```

## GetFontColor

This function returns current FontColor.

#### Syntax

```visualbasic
Function GetFontColor() As Long
```

## SetFormat

This function sets time Format to newformat. Allowed parameter values are

- 1 = H:mm
- 2 = HH:mm
- 3 = h:mm tt
- 4 = H.mm
- 5 = H:mm:ss
- 6 = HH:mm:ss
- 7 = h:mm:ss tt
- 8 = H.mm.ss

The function returns True on success or False if an error occurs.

#### Syntax

```visualbasic
Function SetFormat(newformat As Long) As Boolean
```

## GetFormat

This function returns current time Format.

#### Syntax

```visualbasic
Function GetFormat() As Long
```

## BringToFrontZOrder

This function temporarily brings the object to the very top position.

#### Syntax

```visualbasic
Function BringToFrontZOrder()
```

## RestoreZOrder

This function restores object’s z-order to value defined in design mode.

#### Syntax

```visualbasic
Function RestoreZOrder()
```

# Events

## OnTouch 

This event is generated when the object is touched and property Events is set to True.

#### Syntax

```visualbasic
Event OnTouch As Process()
```