---
name: "BIS_fnc_timeToString"
type: function
status: ok
groups: ["Strings"]
arma3_since: "0.50"
locality: {"argument": "local", "effect": "local", "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_timeToString
revid: 327131
updated: 2022-07-12T21:45:21Z
---

# BIS_fnc_timeToString

*Function · Strings · Arma 3 v0.50*

Locality: arguments **local** · effect **local**

## Description

This function returns a 24-hour time as a string (or array) from a decimal.

## Syntax

```sqf
[time, format] call BIS_fnc_timeToString
```

**Parameters:**

- `time`: [Number](../topics/Number.md) - time to convert (format [dayTime](../commands/dayTime.md))
- `format`: [String](../topics/String.md) - (Optional, default "HH:MM:SS") one of the following:
  - "HH"          - Hour
  - "HH:MM"       - Hour:Minute
  - "HH:MM:SS"    - Hour:Minute:Seconds
  - "HH:MM:SS:MM" - Hour:Minute:Seconds:Milliseconds
  - "ARRAY"       - [Hour, Minute, Seconds, Milliseconds]

**Returns:** [String](../topics/String.md) or [Array](../topics/Array.md)

## Examples

### Example 1

```sqf
private _time = 7.36;
[_time] call BIS_fnc_timeToString; // 07:21:36
```

### Example 2

```sqf
private _time = 7.36;
[_time, "HH:MM"] call BIS_fnc_timeToString; // 07:21
```

## See also

[time](../commands/time.md) · [dayTime](../commands/dayTime.md) · [BIS_fnc_secondsToString](../functions/BIS_fnc_secondsToString.md)

<sub>Source: [BI Community Wiki — BIS fnc timeToString](https://community.bistudio.com/wiki/BIS_fnc_timeToString) (revision 327131).</sub>
