Skip to main content
Module

x/listenbrainz/timestamp.ts>timestamp

Deno library and CLI to access the ListenBrainz API
Latest
function timestamp
import { timestamp } from "https://deno.land/x/listenbrainz@v0.8.1/timestamp.ts";

Converts the given date time string into a Unix timestamp. If no value is passed, it returns the current timestamp.

Parameters

optional
datetime: string

Date time string which is accepted by Date.parse(). Alternatively a HH:mm or HH:mm:ss time without date will be interpreted as being today.

Returns

number

Timestamp in seconds since the Unix epoch.