> For the complete documentation index, see [llms.txt](https://raia-software-inc.gitbook.io/tacview-2-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://raia-software-inc.gitbook.io/tacview-2-documentation/api-reference/api-reference/text-and-formatting/format-absolute-time-for-export.md).

# FormatAbsoluteTimeForExport()

Formats an absolute time for export to a text file.

Use this function when your add-on needs to save a Unix timestamp in a clean and stable textual form.

Unlike user-facing time formatting functions, this function is intended for data export, not localized display.

## Syntax

```lua
timeText = FormatAbsoluteTimeForExport(unixTimeStamp)
```

## Parameters

### unixTimeStamp

Type: `number`

Absolute time expressed as a Unix timestamp.

## Return value

Type: `string`

Returns the time formatted as an ISO-style UTC string.

The result uses the `Z` suffix to indicate UTC.

For example:

```
2011-06-02T05:00:00Z
2011-06-02T05:00:00.25Z
```

Decimal places are included only when required.

## Remarks

`FormatAbsoluteTimeForExport()` is designed for text data that may be read back later.

It outputs a stable UTC timestamp, independently from the user's local time zone and display preferences. This makes exported data predictable and easier to parse.

Use this function for:

* telemetry export
* CSV files
* text files intended to be processed later
* saved add-on data
* values that should remain stable across user settings

Do not use this function for normal user interface output. For labels, logs, panels, and other human-facing text, use a regular time formatting function instead.

## Example

### Export the current playback time

```lua
local currentTime = GetTelemetryPlaybackTime()
local timeText = FormatAbsoluteTimeForExport(currentTime)

-- Write timeText to a text file or exported data stream.
```

## Example

### Export object position with time

```lua
local currentTime = GetTelemetryPlaybackTime()
local transform = GetObjectTransform(objectHandle, currentTime)

if transform ~= nil then

	local line = FormatString(
		"{0},{1},{2},{3}",
		FormatAbsoluteTimeForExport(currentTime),
		FormatLatitudeForExport(transform.latitude),
		FormatLongitudeForExport(transform.longitude),
		FormatAltitudeForExport(transform.altitude))

	-- Write line to an export file.

end
```

## Requirements

Tacview 2.0.0 or later

## See also

* [FormatRelativeTimeForExport()](/tacview-2-documentation/api-reference/api-reference/text-and-formatting/format-relative-time-for-export.md)
* [FormatLatitudeForExport()](/tacview-2-documentation/api-reference/api-reference/text-and-formatting/format-latitude-for-export.md)
* [FormatLongitudeForExport()](/tacview-2-documentation/api-reference/api-reference/text-and-formatting/format-longitude-for-export.md)
* [FormatAltitudeForExport()](/tacview-2-documentation/api-reference/api-reference/text-and-formatting/format-altitude-for-export.md)
* [FormatString()](/tacview-2-documentation/api-reference/api-reference/text-and-formatting/format-string.md)
* [GetTelemetryPlaybackTime()](/tacview-2-documentation/api-reference/api-reference/playback-control/get-telemetry-playback-time.md)
