Dates-LE

v2.5.0
io.github.nolindnaidoo/dates-le Checked 17 hours ago Published 1 month ago

Extract dates and timestamps from logs, data files and code, with their format and position.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

extract_dates

Extract every date and timestamp from a document, with its notation, epoch value where resolvable, and 1-based line and column. Reads any text: JSON, YAML, CSV, XML, log and plaintext, JavaScript, TypeScript, HTML, TOML and Markdown are named formats, and anything else is scanned with the patterns they share. Recognises ISO 8601 in extended, basic, week and ordinal form, RFC formats, day-first and month-first numeric dates, dates with the month written out, and, when `kinds` includes "unix", Unix timestamps from seconds to nanoseconds.

ParameterTypeDescription
content *stringThe document text to scan.
dateOrderstringHow to read a numeric date whose day and month could be either way round, such as 05/01/2024: "mdy" is 1 May, "dmy" is 5 January. A date that can only be read one way, such as 15/01/2024, is read that…
dedupebooleanCollapse repeated dates to their first occurrence.
filenamestringFilename used to infer the format when `format` is absent, e.g. "app.log".
formatstringDocument format. Common extensions and aliases are accepted. Optional: with neither this nor `filename` the document is scanned with the shared patterns.
kindsarrayThe kinds of date to return, by the name each carries as `format` in the answer. Defaults to every kind except "unix": a bare number such as 1705314645 is only read as a date when "unix" is listed.
maxResultsintegerCap on returned dates (default 500). meta.truncated reports whether any were dropped.