---
title: date.nanosecond() function
description: date.nanosecond() returns the nanoseconds for a specified time. Results range from [0-999999999].
url: https://docs.influxdata.com/flux/v0/stdlib/date/nanosecond/
estimated_tokens: 1128
product: Flux
version: v0
---

# date.nanosecond() function

-   Flux 0.37.0+
-   View InfluxDB support

`date.nanosecond()` returns the nanoseconds for a specified time. Results range from `[0-999999999]`.

##### Function type signature

```js
(t: A) => int where A: Timeable
```

For more information, see [Function type signatures](/flux/v0/function-type-signatures/).

## Parameters

### t

(Required) Time to operate on.

Use an absolute time, relative duration, or integer. Durations are relative to `now()`.

## Examples

-   [Return the nanosecond for a time value](#return-the-nanosecond-for-a-time-value)
-   [Return the nanosecond for a relative duration](#return-the-nanosecond-for-a-relative-duration)
-   [Return the current nanosecond unit](#return-the-current-nanosecond-unit)

### Return the nanosecond for a time value

```js
import "date"

date.nanosecond(t: 2020-02-11T12:21:03.29353494Z)// Returns 293534940

```

### Return the nanosecond for a relative duration

```js
import "date"

option now = () => 2020-02-11T12:21:03.29353494Z

date.nanosecond(t: -2111984ns)// Returns 128412016

```

### Return the current nanosecond unit

```js
import "date"

date.nanosecond(t: now())
```

[date/time](/flux/v0/tags/date/time/)
