# time() function

The time() function returns the current
system time in its internal format, representing the number of seconds
past midnight.

## Syntax

```
var = time()
```

## Parameter(s)

| var | Variable to which the internal system time is returned. |
| --- | --- |

## Description

The parentheses following the
function are required, and never contain any arguments.

## Example(s)

This example outputs the current
system time in external format.

```
print ’the time is ’:oconv(time(),’mth’)
```
This is an example of a loop that terminates under two
conditions. Either a key is pressed on the keyboard (system(14)) or 30 seconds has passed without any keystrokes. If no keys are
waiting and the time-out is not over, sleep for a second and check
again.

```
start.time=time()
loop until (time()-start.time)>30 or system(14) do
rqm
repeat
```

## See also

- [BASIC functions](https://d3codex.com/pickbasic-flashbasic/basic-functions/)
- [mt (mask time) processing code](https://d3codex.com/processingcodes/mt-mask-time-processing-code/)
- [oconv() function](https://d3codex.com/pickbasic-flashbasic/oconv-function/)
- [Statements and functions](https://d3codex.com/pickbasic-flashbasic/statements-and-functions/)
- [timedate() function](https://d3codex.com/pickbasic-flashbasic/timedate-function/)

---
Source: https://d3codex.com/pickbasic-flashbasic/time-function/ - part of the D3Codex reference.
