← All pipes
Dates

unixTimestamp

Floor epoch seconds, including pre-1970 values.

Use it in your component

Standalone component
import { Component } from '@angular/core';
import { UnixTimestampPipe } from 'extra-pipe';

@Component({
  standalone: true,
  imports: [UnixTimestampPipe],
  template: `{{ "1970-01-01T00:00:01Z" | unixTimestamp }}`,
})
export class ExampleComponent {

}

Template
{{ "1970-01-01T00:00:01Z" | unixTimestamp }}

Try it live.

The output below runs the packed library. Edit data, not code.

Use double quotes for text, or a number, array, object or null.
No parameters: use []. Locale is controlled separately.
This pipe has no locale override.
Live template data
readonly value = "1970-01-01T00:00:01Z";

{{ value | unixTimestamp }}

Rendered output

1