---
name: "dtk_addtime"
section: "3"
platform: "linux"
package: "libdrawtk-dev"
version: "2.0-2.1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/dtk_addtime"
---

# dtk\_addtime(3)

timestamp adjustment function

## NAME

dtk\_addtime - timestamp adjustment function

## SYNOPSIS

**#include \<dtk\_time.h\>**

**int dtk\_addtime(struct dtk\_timespec\*** *ts***, long** *sec***, long** *nsec***);**\

## DESCRIPTION

The function **dtk\_addtime**() adjusts the time pointed by *ts* by  adding *sec* seconds and *nsec* nanoseconds.

## RETURN VALUE

On success, the function returns 0, otherwise -1.

## ERRORS

**dtk\_addtime**() will fail if:

- **EINVAL**

  The value in the *nsec* field was not in the range -999999999 to 999999999.

## SEE ALSO

[**dtk\_nanosleep**(3)](/dtk_nanosleep/3.md), [**dtk\_gettime**(3)](/dtk_gettime/3.md)
