Skip to content

timestampForFileName

timestampForFileName(date?): string

Defined in: packages/simply-core/src/fs/paths.ts:46

Format a date as a YYYYMMDD_HHMMSS string in local time, for uniquing generated file and directory names.

Local time rather than UTC is deliberate: these names are read by whoever ran the command, so they should line up with that person’s clock.

Date = ...

The date to format. Defaults to now.

string

The formatted timestamp, e.g. 20260817_142530.