npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

karmick-datetime

v0.1.3

Published

This is the package which used to convert datetime as aspect datetime format.

Downloads

4

Readme

karmick-datetime

This is the package which used to convert datetime as aspect datetime format. We just need to provide three argument which are local timezone, datetime to be convert and output datetime format.

For example :
  • var date= require('karmick-datetime');
  • const current_time = '01-09-2019'; //or new Date(); //dd-mm-yyyy
  • console.log( date.toLocaleDateString('IST',current_time,'dD-Mm-yY'));

Installation :

Install the dependencies and devDependencies and start the server.
   
   $ npm i karmick-datetime
  

Local timezone( argument ):

  • "ISO": International Organization for Standardization
  • "hi": Hindi (primary language)
  • "de-AT": German as used in Austria (primary language with country code).
  • "zh-Hans-CN": Chinese written in simplified characters as used in China (primary language with script and country codes).

Datetime to be convert

  • we need to proved date in day, month and year format
  • we need to proved time in hour, minute and second format

Format

Following are the sample of date time format.

| Format | Output | Format | Output |Format | Output |Format | Output | | ------ | ------ | ------ | ------ | ------ | ------ |------ | ------ | | dd-Mm-yY | 01-Mar-90 | dd/Mm/yY | 01/Mar/90 | dd.Mm.yY | 01.Mar.90 | dd Mm yY | 01 Mar 90 | | dd-MM-yY | 01-March-90 | dd/MM/yY | 01/March/90 | dd.MM.yY | 01.March.90 | dd MM yY | 01 March 90 | | dD-Mm-yY | 1-Mar-90 | dD/Mm/yY | 1/Mar/90 | dD.Mm.yY | 1.Mar.90 | dD Mm yY | 1 Mar 90 | | dD-MM-yY | 1-March-90 | dD/MM/yY | 1/March/90 | dD.MM.yY | 1.March.90 | dD MM yY | 1 March 90 | | dd-mm-yY | 1-3-90 | dd/mm/yY | 1/3/90 | dd.mm.yY | 1.3.90 | dd mm yY | 1 3 90 | | dd-mD-yY | 1-03-90 | dd/mD/yY | 1/03/90 | dd.mD.yY | 1.03.90 | dd mD yY | 1 03 90 | | dD-mD-yY | 01-03-90 | dD/mD/yY | 01/03/90 | dD.mD.yY | 01.03.90 | dD mD yY | 01 03 90 | | dd-Mm-yyyy | 01-Mar-2012 | dd/Mm/yyyy | 01/Mar/2012 | dd.Mm.yyyy | 01.Mar.2012 | dd Mm yyyy | 01 Mar 2012 | | dd-MM-yyyy | 01-March-2012 | dd/MM/yyyy | 01/March/2012 | dd.MM.yyyy | 01.March.2012 | dd MM yyyy | 01 March 2012 | | dD-Mm-yyyy | 1-Mar-2012 | dD/Mm/yyyy | 1/Mar/2012 | dD.Mm.yyyy | 1.Mar.2012 | dD Mm yyyy | 1 Mar 2012 | | dD-MM-yyyy | 1-March-2012 | dD/MM/yyyy | 1/March/2012 | dD.MM.yyyy | 1.March.2012 | dD MM yyyy | 1 March 2012 | | dd-mm-yyyy | 1-3-2012 | dd/mm/yyyy | 1/3/2012 | dd.mm.yyyy | 1.3.2012 | dd mm yyyy | 1 3 2012 | | dd-mD-yyyy | 1-03-2012 | dd/mD/yyyy | 1/03/2012 | dd.mD.yyyy | 1.03.2012 | dd mD yyyy | 1 03 2012 | | dD-mD-yyyy | 01-03-2012 | dD/mD/yyyy | 01/03/2012 | dD.mD.yyyy | 01.03.2012 | dD mD yyyy | 01 03 2012 | | Mm-dd-yY | Mar-01-90 | Mm/dd/yY | Mar/01/90 | Mm.dd.yY | Mar.01.90 | Mm dd yY | Mar 01 90 | | MM-dd-yY | March-01-90 | MM/dd/yY | March/01/90 | MM.dd.yY | March.01.90 | MM dd yY | March 01 90 | | Mm-dD-yY | Mar-1-90 | Mm/dD/yY | Mar/1/90 | Mm.dD.yY | Mar.1.90 | Mm dD yY | Mar 1 90 | | MM-dD-yY | March-1-90 | MM/dD/yY | March/1/90 | MM.dD.yY | March.1.90 | MM dD yY | March 1 90 | | mm-dd-yY | 3-1-90 | mm/dd/yY | 3/1/90 | mm.dd.yY | 3.1.90 | mm dd yY | 3 1 90 | | mD-dd-yY | 03-1-90 | mD/dd/yY | 03/1/90 | mD.dd.yY | 03.1.90 | mD dd yY | 03 1 90 | | mD-dD-yY | 03-01-90 | mD/dD/yY | 03/01/90 | mD.dD.yY | 03.01.90 | mD dD yY | 03 01 90 | | Mm-dd-yyyy | Mar-01-2012 | Mm/dd/yyyy | Mar/01/2012 | Mm.dd.yyyy | Mar.01.2012 | Mm dd yyyy | Mar 01 2012 | | MM-dd-yyyy | March-01-2012 | MM/dd/yyyy | March/01/2012 | MM.dd.yyyy | March.01.2012 | MM dd yyyy | March 01 2012 | | Mm-dD-yyyy | Mar-1-2012 | Mm/dD/yyyy | Mar/1/2012 | Mm.dD.yyyy | Mar.1.2012 | Mm dD yyyy | Mar 1 2012 | | MM-dD-yyyy | March-1-2012 | MM/dD/yyyy | March/1/2012 | MM.dD.yyyy | March.1.2012 | MM dD yyyy | March 1 2012 | | mm-dd-yyyy | 3-1-2012 | mm/dd/yyyy | 3/1/2012 | mm.dd.yyyy | 3.1.2012 | mm dd yyyy | 3 1 2012 | | mD-dd-yyyy | 03-1-2012 | mD/dd/yyyy | 03/1/2012 | mD.dd.yyyy | 03.1.2012 | mD dd yyyy | 03 1 2012 | | mD-dD-yyyy | 03-01-2012 | mD/dD/yyyy | 03/01/2012 | mD.dD.yyyy | 03.01.2012 | mD dD yyyy | 03 01 2012 | yY-dd-Mm | 90-01-Mar | yY/dd/Mm | 90/01/Mar | yY.dd.Mm | 90.01.Mar | yY dd Mm | 90 01 Mar | | yY-dd-MM | 90-01-March | yY/dd/MM | 90/01/March | yY.dd.MM | 90.01.March | yY dd MM | 90 01 March | | yY-dD-Mm | 90-1-Mar | yY/dD/Mm | 90/1/Mar | yY.dD.Mm | 90.1.Mar | yY dD Mm | 90 1 Mar | | yY-dD-MM | 90-1-March | yY/dD/MM | 90/1/March | yY.dD.MM | 90.1.March | yY dD MM | 90 1 March | | yY-dd-mm | 90-1-3 | yY/dd/mm | 90/1/3 | yY.dd.mm | 90.1.3 | yY dd mm | 90-1-3 | | yY-dd-mD | 90-1-03 | yY/dd/mD | 90/1/03 | yY.dd.mD | 90.1.03 | yY dd mD | 90 1 03 | | yY-dD-mD | 90-01-03 | yY/dD/mD | 90/01/03 | yY.dD.mD | 90.01.03 | yY dD mD | 90-01-03 | | yyyy-dd-Mm | 2012-01-Mar | yyyy/dd/Mm | 2012/01/Mar | yyyy.dd.Mm | 2012.01.Mar | yyyy dd Mm | 2012 01 Mar | | yyyy-dd-MM | 2012-01-March | yyyy/dd/MM | 2012/01/March | yyyy.dd.MM | 2012.01.March | yyyy dd MM | 2012 01 March | | yyyy-dD-Mm | 2012-1-Mar | yyyy/dD/Mm | 2012/1/Mar | yyyy.dD.Mm | 2012.1.Mar | yyyy dD Mm | 2012 1 Mar | | yyyy-dD-MM | 2012-1-March | yyyy/dD/MM | 2012/1/March | yyyy.dD.MM | 2012.1.March | yyyy dD MM | 2012 1 March | | yyyy-dd-mm | 2012-1-3 | yyyy/dd/mm | 2012/1/3 | yyyy.dd.mm | 2012.1.3 | yyyy dd mm | 2012 1 3 | | yyyy-dd-mD | 2012-1-03 | yyyy/dd/mD | 2012/1/03 | yyyy.dd.mD | 2012.1.03 | yyyy dd mD | 2012 1 03 | | yyyy-dD-mD | 2012-01-03 | yyyy/dD/mD | 2012/01/03 | yyyy.dD.mD | 2012.01.03 | yyyy dD mD | 2012 01 03 | | yY-Mm-dd | 90-Mar-01 | yY/Mm/dd | 90/Mar/01 | yY.Mm.dd | 90.Mar.01 | yY Mm dd | 90 Mar 01 | | yY-MM-dd | 90-March-01 | yY/MM/dd | 90/March/01 | yY.MM.dd | 90.March.01 | yY MM dd | 90 March 01 | | yY-Mm-dD | 90-Mar-1 | yY/Mm/dD | 90/Mar/1 | yY.Mm.dD | 90.Mar.1 | yY Mm dD | 90 Mar 1 | | yY-MM-dD | 90-March-1 | yY/MM/dD | 90/March/1 | yY.MM.dD | 90.March.1 | yY MM dD | 90 March 1 | | yY-mm-dd | 90-3-1 | yY/mm/dd | 90/3/1 | yY.mm.dd | 90.3.1 | yY mm dd | 90 3 1 | | yY-mD-dd | 90-03-1 | yY/mD/dd | 90/03/1 | yY.mD.dd | 90.03.1 | yY mD dd | 90 03 1 | | yY-mD-dD | 90-03-01 | yY/mD/dD | 90/03/01 | yY.mD.dD | 90.03.01 | yY mD dD | 90 03 01 | | yyyy-Mm-dd | 2012-Mar-01 | yyyy/Mm/dd | 2012/Mar/01 | yyyy.Mm.dd | 2012.Mar.01 | yyyy Mm dd | 2012 Mar 01 | | yyyy-MM-dd | 2012-March-01 | yyyy/MM/dd | 2012/March/01 | yyyy.MM.dd | 2012.March.01 | yyyy MM dd | 2012 March 01 | | yyyy-Mm-dD | 2012-Mar-1 | yyyy/Mm/dD | 2012/Mar/1 | yyyy.Mm.dD | 2012.Mar.1 | yyyy Mm dD | 2012 Mar 1 | | yyyy-MM-dD | 2012-March-1 | yyyy/MM/dD | 2012/March/1 | yyyy.MM.dD | 2012.March.1 | yyyy MM dD | 2012 March 1 | | yyyy-mm-dd | 2012-3-1 | yyyy/mm/dd | 2012/3/1 | yyyy.mm.dd | 2012.3.1 | yyyy mm dd | 2012 3 1 | | yyyy-mD-dd | 2012-03-1 | yyyy/mD/dd | 2012/03/1 | yyyy.mD.dd | 2012.03.1 | yyyy mD dd | 2012 03 1 | | yyyy-mD-dD | 2012-03-01 | yyyy/mD/dD | 2012/03/01 | yyyy.mD.dD | 2012.03.01 | yyyy mD dD | 2012 03 01 | | yyyy-mD-dD | 2012-03-01 | yyyy/mD/dD | 2012/03/01 | yyyy.mD.dD | 2012.03.01 | yyyy mD dD | 2012 03 01 | | DD, MM OD, yyyy | Saturday, June 9th, 2007 | DD, OD MM, yyyy | Saturday, 9th June, 2007 | | DD, MM OD, yY | Saturday, June 9th, 07 | DD, OD MM, yY | Saturday, 9th June, 07 | | Dd, MM OD, yyyy | Sat, June 9th, 2017 | Dd, OD MM, yyyy | Sat, 9th June, 2017 | | Dd, MM OD, yY | Sat, June 9th, 17 | Dd, OD MM, yY | Sat, 9th June, 17 | | DD, Mm OD, yyyy | Saturday, Jan 9th, 2007 | DD, OD Mm, yyyy | Saturday, 9th Jan, 2007 | | DD, Mm OD, yY | Saturday, Jan 9th, 07 | DD, OD Mm, yY | Saturday, 9th Jan, 07 | | Dd, Mm OD, yyyy | Sat, Jan 9th, 2017 | Dd, OD Mm, yyyy | Sat, 9th Jan, 2017 | | Dd, Mm OD, yY | Sat, Jan 9th, 17 | Dd, OD Mm, yY | Sat, 9th Jan, 17 | | DD, mD OD, yyyy | Saturday, 06 9th, 2007 | DD, OD mD, yyyy | Saturday, 9th 06, 2007 | | DD, mD OD, yY | Saturday, 06 9th, 07 | DD, OD mD, yY | Saturday, 9th 06, 07 | | Dd, mD OD, yyyy | Sat, 06 9th, 2017 | Dd, OD mD, yyyy | Sat, 9th 06, 2017 | | Dd, mD OD, yY | Sat, 06 9th, 17 | Dd, OD mD, yY | Sat, 9th 06, 17 | | DD, mm OD, yyyy | Saturday, 6 9th, 2007 | DD, OD mm, yyyy | Saturday, 9th 6, 2007 | | DD, mm OD, yY | Saturday, 6 9th, 07 | DD, OD mm, yY | Saturday, 9th 6, 07 | | Dd, mm OD, yyyy | Sat, 6 9th, 2017 | Dd, OD mm, yyyy | Sat, 9th 6, 2017 | | Dd, mm OD, yY | Sat, 6 9th, 17 | Dd, OD mm, yY | Sat, 9th 6, 17 | | DD, Mm dD, yyyy | Saturday, Jan 09, 2007 | DD, dD Mm, yyyy | Saturday, 09 Jan, 2007 | | DD, Mm dD, yY | Saturday, Jan 09, 07 | DD, dD Mm, yY | Saturday, 09 Jan, 07 | | Dd, Mm dD, yyyy | Sat, Jan 09, 2017 | Dd, dD Mm, yyyy | Sat, 09 Jan, 2017 | | Dd, Mm dD, yY | Sat, Jan 09, 17 | Dd, dD Mm, yY | Sat, 09 Jan, 17 | | DD, MM dD, yyyy | Saturday, June 09, 2007 | DD, dD MM, yyyy | Saturday, 09 June, 2007 | | DD, MM dD, yY | Saturday, June 09, 07 | DD, dD MM, yY | Saturday, 09 June, 07 | | Dd, MM dD, yyyy | Sat, June 09, 2017 | Dd, dD MM, yyyy | Sat, 09 June, 2017 | | Dd, MM dD, yY | Sat, June 09, 17 | Dd, dD MM, yY | Sat, 09 June, 17 |
| DD, mD dD, yyyy | Saturday, 06 09, 2007 | DD, dD mD, yyyy | Saturday, 09 06, 2007 | | DD, mD dD, yY | Saturday, 06 09, 07 | DD, dD mD, yY | Saturday, 09 06, 07 | | Dd, mD dD, yyyy | Sat, 06 09, 2017 | Dd, dD mD, yyyy | Sat, 09 06, 2017 | | Dd, mD dD, yY | Sat, 06 09, 17 | Dd, dD mD, yY | Sat, 09 06, 17 | | DD, mm dD, yyyy | Saturday, 06 09, 2007 | DD, dD mm, yyyy | Saturday, 09 06, 2007 | | DD, mm dD, yY | Saturday, 06 09, 07 | DD, dD mm, yY | Saturday, 09 06, 07 | | Dd, mm dD, yyyy | Sat, 06 09, 2017 | Dd, dD mm, yyyy | Sat, 09 06, 2017 | | Dd, mm dD, yY | Sat, 06 09, 17 | Dd, dD mm, yY | Sat, 09 06, 17 | | DD, MM dd, yyyy | Saturday, June 9, 2007 | DD, dd MM, yyyy | Saturday, 9 June, 2007 | | DD, MM dd, yY | Saturday, June 9, 07 | DD, dd MM, yY | Saturday, 9 June, 07 | | Dd, MM dd, yyyy | Sat, June 9, 2017 | Dd, dd MM, yyyy | Sat, 9 June, 2017 | | Dd, MM dd, yY | Sat, June 9, 17 | Dd, dd MM, yY | Sat, 9 June, 17 | | DD, Mm dd, yyyy | Saturday, Jan 9, 2007 | DD, dd Mm, yyyy | Saturday, 9 Jan, 2007 | | DD, Mm dd, yY | Saturday, Jan 9, 07 | DD, dd Mm, yY | Saturday, 9 Jan, 07 | | Dd, Mm dd, yyyy | Sat, Jan 9, 2017 | Dd, dd Mm, yyyy | Sat, 9 Jan, 2017 |
| Dd, Mm dd, yY | Sat, Jan 9, 17 | Dd, dd Mm, yY | Sat, 9 Jan, 17 | | DD, mD dd, yyyy | Saturday, 06 9, 2007 | DD, dd mD, yyyy | Saturday, 9 06, 2007 |
| DD, mD dd, yY | Saturday, 06 9, 07 | DD, dd mD, yY | Saturday, 9 06, 07 | | Dd, mD dd, yyyy | Sat, 06 9, 2017 | Dd, dd mD, yyyy | Sat, 9 06, 2017 | | Dd, mD dd, yY | Sat, 06 9, 17 | Dd, dd mD, yY | Sat, 9 06, 17 | | DD, mm dd, yyyy | Saturday, 6 9, 2007 | DD, dd mm, yyyy | Saturday, 9 6, 2007 |
| DD, mm dd, yY | Saturday, 6 9, 07 | DD, mm dd, yY | Saturday, 9 6, 07 | | Dd, mm dd, yyyy | Sat, 6 9, 2017 | Dd, mm dd, yyyy | Sat, 9 6, 2017 | | Dd, mm dd, yY | Sat, 6 9, 17 | Dd, dd mm, yY | Sat, 9 6, 17 |

Datetime format details

Weekday
The representation of the weekday. Possible values are:
   "DD" => "long" (e.g., Thursday)
   "Dd" => "short" (e.g., Thu)
day
The representation of the day. Possible values are:
	"dd" => "numeric" (e.g., 1)
	"dD" => "2-digit" (e.g., 01)
month
The representation of the month. Possible values are:
	"mm" => "numeric" (e.g., 2)
	"mD" => "2-digit" (e.g., 02)
	"MM" => "long" (e.g., March)
	"Mm" => "short" (e.g., Mar)
year
The representation of the year. Possible values are:
	"yyyy" => "numeric" (e.g., 2012)
	"yY" => "2-digit" (e.g., 12)
hour
The representation of the hour. Possible values are:
	"hh" => "numeric" (e.g., 01)
	"hH" => "2-digit" (e.g., 1)
minute
The representation of the minute. Possible values are:
	"mm" => "numeric" (e.g., 01)
	"mM" => "2-digit" (e.g., 1)
second
The representation of the second. Possible values:
	"ss" => "numeric" (e.g., 01)
	"sS" => "2-digit" (e.g., 1)
ordinal suffix
The representation of the ordinal suffix. Possible values:
	"OD" => "ordinal suffix date" (e.g., 1st,23rd)

License

MIT