---
name: "SDL_TimeToDateTime"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_TimeToDateTime"
---

# SDL\_TimeToDateTime(3)

Converts an SDL\_Time in nanoseconds since the epoch to a calendar time in the SDL\_DateTime format.

## NAME

SDL\_TimeToDateTime - Converts an  **SDL\_Time**\
  in nanoseconds since the epoch to a calendar time in the  **SDL\_DateTime**\
  format.

## HEADER FILE

Defined in SDL3/SDL\_time.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**bool SDL\_TimeToDateTime(SDL\_Time ticks, SDL\_DateTime \*dt, bool localTime);**

## FUNCTION PARAMETERS

- *ticks*

  the  **SDL\_Time**\
    to be converted.

- *dt*

  the resulting  **SDL\_DateTime** .

- *localTime*

  the resulting  **SDL\_DateTime**\
    will be expressed in local time if true, otherwise it will be in Universal Coordinated Time (UTC).

## RETURN VALUE

Returns true on success or false on failure; call

**SDL\_GetError** () for more information.

## AVAILABILITY

This function is available since SDL 3.2.0.
