# Timestamp

## pub struct Timestamp

How timestamps are encoded in a file, plus which column holds them.

Use [`Timestamp::iso8601`](https://dev.nominal.io/rust-client/ref/rust/nominal/core/struct.Timestamp.md#method.iso8601 "nominal::core::Timestamp::iso8601"), [`Timestamp::epoch`](https://dev.nominal.io/rust-client/ref/rust/nominal/core/struct.Timestamp.md#method.epoch "nominal::core::Timestamp::epoch"), [`Timestamp::custom`](https://dev.nominal.io/rust-client/ref/rust/nominal/core/struct.Timestamp.md#method.custom "nominal::core::Timestamp::custom"), or
[`Timestamp::relative`](https://dev.nominal.io/rust-client/ref/rust/nominal/core/struct.Timestamp.md#method.relative "nominal::core::Timestamp::relative") to construct one.

## Implementations

### impl Timestamp

#### pub fn iso8601(series_name: impl Into<String>) -> Self

Timestamps are ISO 8601 strings.

#### pub fn epoch(series_name: impl Into<String>, unit: TimeUnit) -> Self

Timestamps are numeric epochs in the given unit (e.g. epoch-seconds).

#### pub fn custom(series_name: impl Into<String>, format: impl Into<String>) -> Self

Timestamps use a custom format string (Java `DateTimeFormatter` syntax).

#### pub fn relative(series_name: impl Into<String>, unit: TimeUnit) -> Self

Timestamps are numeric offsets in the given unit relative to a start
time. Use [`Self::with_offset`](https://dev.nominal.io/rust-client/ref/rust/nominal/core/struct.Timestamp.md#method.with_offset "nominal::core::Timestamp::with_offset") to set the start time (required when
ingesting into an existing dataset).

#### pub fn with_offset(self, offset: DateTime<Utc>) -> Self

Set the starting offset for a relative timestamp.

#### pub fn with_default_year(self, year: i32) -> Self

Set a default year for custom-format timestamps that lack year
information (e.g. IRIG). No-op for other kinds.

#### pub fn with_default_day_of_year(self, day: i32) -> Self

Set a default day-of-year for custom-format timestamps that lack date
information. No-op for other kinds.

## Trait implementations

**Derived**: [`Debug`](https://doc.rust-lang.org/1.98.1/core/fmt/trait.Debug.html), [`Clone`](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html)

**Auto traits**: [`Send`](https://doc.rust-lang.org/1.98.1/core/marker/trait.Send.html), [`Sync`](https://doc.rust-lang.org/1.98.1/core/marker/trait.Sync.html), [`Unpin`](https://doc.rust-lang.org/1.98.1/core/marker/trait.Unpin.html), [`UnwindSafe`](https://doc.rust-lang.org/1.98.1/core/panic/unwind_safe/trait.UnwindSafe.html), [`RefUnwindSafe`](https://doc.rust-lang.org/1.98.1/core/panic/unwind_safe/trait.RefUnwindSafe.html)
