Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/lume/core/utils/date.ts>parseDateFromFilename

🔥 Static site generator for Deno 🦕
Very Popular
Go to Latest
function parseDateFromFilename
import { parseDateFromFilename } from "https://deno.land/x/lume@v2.1.0/core/utils/date.ts";

Parse a date/datetime from a filename.

Filenames can be prepended with a date (yyyy-mm-dd) or datetime (yyyy-mm-dd-hh-ii-ss) followed by an underscore (_) or hyphen (-).

Parameters

filename: string

Returns

[string, Date | undefined]