📆 Convert date to DTG
# Using npm
npm install dtg-format
# Using yarn
yarn add dtg-format
Format a date object to dtg-format.
withTimezone
is default false
, if true
its add the local computer timezone.
// CommonJS
const { toDTG } = require("dtg-format");
// ESM
import { toDTG } from "dtg-format";
const date = new Date("August 19, 2022 23:15:30 UTC+2");
const dtg = toDTG(date);
--> "192315aug22"
Published under MIT - Made with ❤️ by Conner Bachmann