---
name: "SDL_DateTimeToTime"
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_DateTimeToTime"
---

# SDL\_DateTimeToTime(3)

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

## NAME

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

## HEADER FILE

Defined in SDL3/SDL\_time.h

## SYNOPSIS

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

**bool SDL\_DateTimeToTime(const SDL\_DateTime \*dt, SDL\_Time \*ticks);**

## DESCRIPTION

This function ignores the day\_of\_week member of the

**SDL\_DateTime**\
  struct, so it may remain unset.

## FUNCTION PARAMETERS

- *dt*

  the source  **SDL\_DateTime** .

- *ticks*

  the resulting  **SDL\_Time** .

## 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.
