---
title: sample.alignToNow() function
description: sample.alignToNow() shifts time values in input data to align the chronological last point to now.
url: https://docs.influxdata.com/flux/v0/stdlib/influxdata/influxdb/sample/aligntonow/
estimated_tokens: 677
product: Flux
version: v0
---

# sample.alignToNow() function

-   Flux 0.123.0+
-   View InfluxDB support

`sample.alignToNow()` shifts time values in input data to align the chronological last point to *now*.

When writing static historical sample datasets to **InfluxDB Cloud**, use `alignToNow()` to avoid losing sample data with timestamps outside of the retention period associated with your InfluxDB Cloud account.

Input data must have a `_time` column.

##### Function type signature

```js
(<-tables: stream[A]) => stream[A] where A: Record
```

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

## Parameters

### tables

Input data. Defaults to piped-forward data (`<-`).

## Examples

### Align sample data to now

```js
import "influxdata/influxdb/sample"

sample.data(set: "birdMigration")
    |> sample.alignToNow()
```

#### Related

-   [Sample data](/influxdb/v2/reference/sample-data/)

[transformations](/flux/v0/tags/transformations/)
