# tf.timestamp

<br />

Provides the time since epoch in seconds.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.timestamp`](https://www.tensorflow.org/api_docs/python/tf/timestamp)

<br />

    tf.timestamp(
        name=None
    ) -> Annotated[Any, _atypes.Float64]

### Used in the notebooks

| Used in the tutorials |
|---|
| - [Random noise generation in TFF](https://www.tensorflow.org/federated/tutorials/random_noise_generation) |

Returns the timestamp as a `float64` for seconds since the Unix epoch.

#### Common usages include:

- Logging
- Providing a random number seed
- Debugging graph execution
- Generating timing information, mainly through comparison of timestamps

> [!NOTE]
> **Note:** In graph mode, the timestamp is computed when the op is executed, not when it is added to the graph. In eager mode, the timestamp is computed when the op is eagerly executed.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `name` | A name for the operation (optional). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `Tensor` of type `float64`. ||

<br />