{"_id":"dateformat@5.0.4","bugs":{"url":"https://github.com/felixge/node-dateformat/issues"},"dist":{"shasum":"d0b4638f252bb5ccd234f77c2d1f0e1876a3a2df","tarball":"http://registry-npm.ywwl.com/dateformat/download/dateformat-5.0.4.tgz","fileCount":4,"integrity":"sha512-DnMqBsxDYMXnJ1c6TY8AgalunEVV5LBm1INpkod2A60Ldw/bopC/MGH0bEoK0S+I66Juezz36snGuWrEp9FmNg==","signatures":[{"sig":"MEUCICUr3pWdpZo8JPed157SwmXJD0jjb5mIBgH9XhTA5/XOAiEAkdCgLllvL+nEJwcabIX6k2ZBPToztTlMVy8MCV3oErs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGIJNmLffE9izHr8ghYDUV391QLI8Kl1QbI+dFGgZxkfAiBbTt9cEBymu/eJx24aiYvH0R0OXJLmI9sS+M5MfKPRMw=="}],"unpackedSize":19783,"size":6064,"noattachment":false,"key":"/dateformat/-/dateformat-5.0.4.tgz"},"main":"lib/dateformat.js","name":"dateformat","type":"module","author":{"name":"Steven Levithan"},"engines":{"node":">=12.20"},"gitHead":"3256ab8d8162fb09818c4daf1a2b912af756e6d1","license":"MIT","scripts":{"test":"npm run build && mocha","build":"babel src --out-dir lib && uglifyjs lib/dateformat.js -o lib/dateformat.js","benchmark":"npm run build && node ./benchmark/benchmark.js"},"version":"5.0.4","_npmUser":{"name":"chase-manning","email":"chase@manning.dev"},"homepage":"https://github.com/felixge/node-dateformat","repository":{"url":"git+https://github.com/felixge/node-dateformat.git","type":"git"},"_npmVersion":"10.9.4","description":"A node.js package for Steven Levithan's excellent dateFormat() function.","directories":{},"maintainers":[{"name":"felixge","email":"felix@debuggable.com"},{"name":"ctavan","email":"dev@tavan.de"},{"name":"jonschlinkert","email":"github@sellside.com"},{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"fpintos","email":"fpintos.npm@outlook.com"},{"name":"chase-manning","email":"chase@manning.dev"}],"_nodeVersion":"22.21.1","contributors":[{"name":"Steven Levithan"},{"name":"Felix Geisendörfer","email":"felix@debuggable.com"},{"name":"Christoph Tavan","email":"dev@tavan.de"},{"url":"https://github.com/jonschlinkert","name":"Jon Schlinkert"},{"name":"Chase Manning","email":"me@chasemanning.co.nz"}],"_hasShrinkwrap":false,"devDependencies":{"mocha":"^9.0.3","uglify-js":"^3.14.1","@babel/cli":"^7.14.8","@babel/core":"^7.15.0","@babel/preset-env":"^7.15.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dateformat_5.0.4_1791736936588_0.6577713277829957"},"readme":"# dateformat\n\nA node.js package for Steven Levithan's excellent [dateFormat()][dateformat] function.\n\n## Modifications\n\n- Removed the `Date.prototype.format` method. Sorry folks, but extending native prototypes is for suckers.\n- Added a `module.exports = dateFormat;` statement at the bottom\n- Added the placeholder `N` to get the ISO 8601 numeric representation of the day of the week\n\n## Installation\n\n```bash\n$ npm install dateformat\n$ dateformat --help\n```\n\n## Usage\n\nAs taken from Steven's post, modified to match the Modifications listed above:\n\n```js\nimport dateFormat, { masks } from \"dateformat\";\nconst now = new Date();\n\n// Basic usage\ndateFormat(now, \"dddd, mmmm dS, yyyy, h:MM:ss TT\");\n// Saturday, June 9th, 2007, 5:46:21 PM\n\n// You can use one of several named masks\ndateFormat(now, \"isoDateTime\");\n// 2007-06-09T17:46:21\n\n// ...Or add your own\nmasks.hammerTime = 'HH:MM! \"Can\\'t touch this!\"';\ndateFormat(now, \"hammerTime\");\n// 17:46! Can't touch this!\n\n// You can also provide the date as a string\ndateFormat(\"Jun 9 2007\", \"fullDate\");\n// Saturday, June 9, 2007\n\n// Note that if you don't include the mask argument,\n// dateFormat.masks.default is used\ndateFormat(now);\n// Sat Jun 09 2007 17:46:21\n\n// And if you don't include the date argument,\n// the current date and time is used\ndateFormat();\n// Sat Jun 09 2007 17:46:22\n\n// You can also skip the date argument (as long as your mask doesn't\n// contain any numbers), in which case the current date/time is used\ndateFormat(\"longTime\");\n// 5:46:22 PM EST\n\n// And finally, you can convert local time to UTC time. Simply pass in\n// true as an additional argument (no argument skipping allowed in this case):\ndateFormat(now, \"longTime\", true);\n// 10:46:21 PM UTC\n\n// ...Or add the prefix \"UTC:\" or \"GMT:\" to your mask.\ndateFormat(now, \"UTC:h:MM:ss TT Z\");\n// 10:46:21 PM UTC\n\n// You can also get the ISO 8601 week of the year:\ndateFormat(now, \"W\");\n// 42\n\n// and also get the ISO 8601 numeric representation of the day of the week:\ndateFormat(now, \"N\");\n// 6\n```\n\n### Mask options\n\n| Mask             | Description                                                                                                                                                   |\n| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `d`              | Day of the month as digits; no leading zero for single-digit days.                                                                                            |\n| `dd`             | Day of the month as digits; leading zero for single-digit days.                                                                                               |\n| `ddd`            | Day of the week as a three-letter abbreviation.                                                                                                               |\n| `DDD`            | \"Ysd\", \"Tdy\" or \"Tmw\" if date lies within these three days. Else fall back to ddd.                                                                            |\n| `dddd`           | Day of the week as its full name.                                                                                                                             |\n| `DDDD`           | \"Yesterday\", \"Today\" or \"Tomorrow\" if date lies within these three days. Else fall back to dddd.                                                              |\n| `m`              | Month as digits; no leading zero for single-digit months.                                                                                                     |\n| `mm`             | Month as digits; leading zero for single-digit months.                                                                                                        |\n| `mmm`            | Month as a three-letter abbreviation.                                                                                                                         |\n| `mmmm`           | Month as its full name.                                                                                                                                       |\n| `yy`             | Year as last two digits; leading zero for years less than 10.                                                                                                 |\n| `yyyy`           | Year represented by four digits.                                                                                                                              |\n| `h`              | Hours; no leading zero for single-digit hours (12-hour clock).                                                                                                |\n| `hh`             | Hours; leading zero for single-digit hours (12-hour clock).                                                                                                   |\n| `H`              | Hours; no leading zero for single-digit hours (24-hour clock).                                                                                                |\n| `HH`             | Hours; leading zero for single-digit hours (24-hour clock).                                                                                                   |\n| `M`              | Minutes; no leading zero for single-digit minutes.                                                                                                            |\n| `MM`             | Minutes; leading zero for single-digit minutes.                                                                                                               |\n| `N`              | ISO 8601 numeric representation of the day of the week.                                                                                                       |\n| `o`              | GMT/UTC timezone offset, e.g. -0500 or +0230.                                                                                                                 |\n| `p`              | GMT/UTC timezone offset, e.g. -05:00 or +02:30.                                                                                                               |\n| `s`              | Seconds; no leading zero for single-digit seconds.                                                                                                            |\n| `ss`             | Seconds; leading zero for single-digit seconds.                                                                                                               |\n| `S`              | The date's ordinal suffix (st, nd, rd, or th). Works well with `d`.                                                                                           |\n| `l`              | Milliseconds; gives 3 digits.                                                                                                                                 |\n| `L`              | Milliseconds; gives 2 digits.                                                                                                                                 |\n| `t`              | Lowercase, single-character time marker string: a or p.                                                                                                       |\n| `tt`             | Lowercase, two-character time marker string: am or pm.                                                                                                        |\n| `T`              | Uppercase, single-character time marker string: A or P.                                                                                                       |\n| `TT`             | Uppercase, two-character time marker string: AM or PM.                                                                                                        |\n| `W`              | ISO 8601 week number of the year, e.g. 4, 42                                                                                                                  |\n| `WW`             | ISO 8601 week number of the year, leading zero for single-digit, e.g. 04, 42                                                                                  |\n| `Z`              | US timezone abbreviation, e.g. EST or MDT. For non-US timezones, the GMT/UTC offset is returned, e.g. GMT-0500                                                |\n| `'...'`, `\"...\"` | Literal character sequence. Surrounding quotes are removed.                                                                                                   |\n| `UTC:`           | Must be the first four characters of the mask. Converts the date from local time to UTC/GMT/Zulu time before applying the mask. The \"UTC:\" prefix is removed. |\n\n### Named Formats\n\n| Name              | Mask                           | Example                  |\n| ----------------- | ------------------------------ | ------------------------ |\n| `default`         | `ddd mmm dd yyyy HH:MM:ss`     | Sat Jun 09 2007 17:46:21 |\n| `shortDate`       | `m/d/yy`                       | 6/9/07                   |\n| `paddedShortDate` | `mm/dd/yyyy`                   | 06/09/2007               |\n| `mediumDate`      | `mmm d, yyyy`                  | Jun 9, 2007              |\n| `longDate`        | `mmmm d, yyyy`                 | June 9, 2007             |\n| `fullDate`        | `dddd, mmmm d, yyyy`           | Saturday, June 9, 2007   |\n| `shortTime`       | `h:MM TT`                      | 5:46 PM                  |\n| `mediumTime`      | `h:MM:ss TT`                   | 5:46:21 PM               |\n| `longTime`        | `h:MM:ss TT Z`                 | 5:46:21 PM EST           |\n| `isoDate`         | `yyyy-mm-dd`                   | 2007-06-09               |\n| `isoTime`         | `HH:MM:ss`                     | 17:46:21                 |\n| `isoDateTime`     | `yyyy-mm-dd'T'HH:MM:sso`       | 2007-06-09T17:46:21+0700 |\n| `isoUtcDateTime`  | `UTC:yyyy-mm-dd'T'HH:MM:ss'Z'` | 2007-06-09T22:46:21Z     |\n\n### Localization\n\nDay names, month names and the AM/PM indicators can be localized by\npassing an object with the necessary strings. For example:\n\n```js\nimport { i18n } from \"dateformat\";\n\ni18n.dayNames = [\n  \"Sun\",\n  \"Mon\",\n  \"Tue\",\n  \"Wed\",\n  \"Thu\",\n  \"Fri\",\n  \"Sat\",\n  \"Sunday\",\n  \"Monday\",\n  \"Tuesday\",\n  \"Wednesday\",\n  \"Thursday\",\n  \"Friday\",\n  \"Saturday\",\n];\n\ni18n.monthNames = [\n  \"Jan\",\n  \"Feb\",\n  \"Mar\",\n  \"Apr\",\n  \"May\",\n  \"Jun\",\n  \"Jul\",\n  \"Aug\",\n  \"Sep\",\n  \"Oct\",\n  \"Nov\",\n  \"Dec\",\n  \"January\",\n  \"February\",\n  \"March\",\n  \"April\",\n  \"May\",\n  \"June\",\n  \"July\",\n  \"August\",\n  \"September\",\n  \"October\",\n  \"November\",\n  \"December\",\n];\n\ni18n.timeNames = [\"a\", \"p\", \"am\", \"pm\", \"A\", \"P\", \"AM\", \"PM\"];\n```\n\n> Notice that only one language is supported at a time and all strings\n> _must_ be present in the new value.\n\n### Breaking change in 2.1.0\n\n- 2.1.0 was published with a breaking change, for those using localized strings.\n- 2.2.0 has been published without the change, to keep packages refering to ^2.0.0 to continue working. This is now branch v2_2.\n- 3.0.\\* contains the localized AM/PM change.\n\n## License\n\n(c) 2007-2009 Steven Levithan [stevenlevithan.com][stevenlevithan], MIT license.\n\n[dateformat]: http://blog.stevenlevithan.com/archives/date-time-format\n[stevenlevithan]: http://stevenlevithan.com/\n","publish_time":1791736936661,"_cnpm_publish_time":1791736936661,"dist-tags":{"latest":"5.0.5"}}