Files
xen-orchestra/@xen-orchestra/backups/_filenameDate.js
2022-02-22 12:34:41 +01:00

9 lines
274 B
JavaScript

'use strict'
const { utcFormat, utcParse } = require('d3-time-format')
// Format a date in ISO 8601 in a safe way to be used in filenames
// (even on Windows).
exports.formatFilenameDate = utcFormat('%Y%m%dT%H%M%SZ')
exports.parseFilenameDate = utcParse('%Y%m%dT%H%M%SZ')