Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
date-to-iso-8601-string
Advanced tools
Presents a JavaScript `Date` as a string in [ISO 8601 format](https://www.loc.gov/standards/datetime/iso-tc154-wg5_n0038_iso_wd_8601-1_2016-02-16.pdf), with support for the Extended (`YYYY-MM-DD`) and Basic (`YYYYMMDD`) variants
Presents a JavaScript Date
as a string in ISO 8601 format, with support for the Extended (YYYY-MM-DD
) and Basic (YYYYMMDD
) variants.
Note that this module uses the "local date" in the time zone of the machine, rather than the UTC dfate.
This package includes TypeScript types.
# With npm
npm install --save date-to-iso-8601-string
# With Yarn
yarn add date-to-iso-8601-string
YYYY-MM-DD
format)// You can also import as a CommonJS module using `require`
import { dateToISO8601String } from 'date-to-iso-8601-string';
const date = new Date('2023-01-01');
dateToISO8601String(date);
//=> '2023-01-01'
YYYY-MM-DD
format)import { dateToISO8601String, ISO8601DateFormat } from 'date-to-iso-8601-string';
const date = new Date('2023-01-01');
dateToISO8601String(date, ISO8601DateFormat.Basic);
//=> '20230101'
src/
is written with Typescript.
dist/esm
) and CommonJS form (dist/commonjs
) by running npm run build
.npm
thanks to a prepublish
hook.npm run test
.npm run lint
, and automatically fix many failures with npm run lint-and-fix
.The compilation, testing and build process are automatically run on pushed code using GitHub Actions.
The following blog posts were very helpful for putting this - my first ever npm
package - together!:
FAQs
Presents a JavaScript `Date` as a string in [ISO 8601 format](https://www.loc.gov/standards/datetime/iso-tc154-wg5_n0038_iso_wd_8601-1_2016-02-16.pdf), with support for the Extended (`YYYY-MM-DD`) and Basic (`YYYYMMDD`) variants
The npm package date-to-iso-8601-string receives a total of 1 weekly downloads. As such, date-to-iso-8601-string popularity was classified as not popular.
We found that date-to-iso-8601-string demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.