---
name: "elftc_timestamp"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/elftc_timestamp"
---

# elftc\_timestamp(3)

return the current or environment-provided timestamp

## NAME

**elftc\_timestamp** – return the current or environment-provided timestamp

## LIBRARY

library “libelftc”

## SYNOPSIS

**#include \<libelftc.h\>**

*int*\

**elftc\_timestamp**(*time\_t \*timestamp*);

## DESCRIPTION

The **elftc\_timestamp**() function returns a timestamp supplied by the SOURCE\_DATE\_EPOCH environment variable, or the current time provided by [time(3)](/time/3.md) if the environment variable is not set.

The *timestamp* argument specifies a pointer to the location where the timestamp will be stored.

## RETURN VALUES

Function **elftc\_timestamp**() returns 0 on success, and -1 in the event of an error.

## ERRORS

The **elftc\_timestamp**() function may fail with the following errors:

- \[EINVAL\]

  SOURCE\_DATE\_EPOCH contains invalid characters.

- \[ERANGE\]

  SOURCE\_DATE\_EPOCH specifies a negative value or a value that cannot be stored in a time\_t.

The **elftc\_timestamp**() function may also fail for any of the reasons described in [strtoll(3)](/strtoll/3.md).

## SEE ALSO

[strtoll(3)](/strtoll/3.md), [time(3)](/time/3.md)
