Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

time-date-tools

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

time-date-tools - npm Package Compare versions

Comparing version 0.0.1 to 0.0.11

out/index.js

2

package.json
{
"name": "time-date-tools",
"version": "0.0.1",
"version": "0.0.11",
"description": "",

@@ -5,0 +5,0 @@ "main": "./out/index.js",

@@ -35,2 +35,6 @@

<br>
You can enclose certain parts of your format with brackets `[]`, the values contained in these brackets will be displayed even if they are null.
<u>Some usage examples:</u>

@@ -169,1 +173,61 @@

```
<br>
# Datas
Availables tokens for the date format.
|Token|Description|Output|
|:-:|:-:|:-:|
|Y|four-digit year|2022|
|y|two-digit year|22|
|MMOO|month name|January|
|MO|two-digit month|01|
|mo|month|1|
|DD|day name|Monday|
|D|two-digit day|01|
|D-|two-digit day with indice|01st|
|d|day|1|
|d-|one-digit day with indice|1st|
|H|two-digit hour|09, 14|
|h|hour|9, 14|
|M|two-digit minute|05, 34|
|m|minute|5, 34|
|S|two-digit second|02, 58|
|s|second|2, 58|
|MS|three-digit millisecond|009, 158|
|ms|millisecond|9, 158|
Availables tokens for the time format.
|Token|Description|Output|
|:-:|:-:|:-:|
|YY|year unity (long)|year, years|
|yy|year unity (short)|y|
|Y|four-digit year|2022|
|y|two-digit year|22|
|MMOO|month unity (long)|month, months|
|mmoo|month unity (short)|m|
|MO|two-digit month|01|
|mo|month|1|
|DD|day unity (long)|day, days|
|dd|day unity (short)|d|
|D|two-digit day|01|
|d|day|1|
|HH|hour unity (long)|hour, hours|
|hh|hour unity (short)|h|
|H|two-digit hour|09, 14|
|h|hour|9, 14|
|MM|minute unity (long)|minute, minutes|
|mm|minute unity (short)|m|
|M|two-digit minute|05, 34|
|m|minute|5, 34|
|SS|second unity (long)|seconds, second|
|ss|second unity (short)|s|
|S|two-digit second|02, 58|
|s|second|2, 58|
|MMSS|millisecond unity (long)|millisecond, milliseconds|
|mmss|millisecond unity (short)|ms|
|MS|three-digit millisecond|009, 158|
|ms|millisecond|9, 158|

@@ -1,9 +0,8 @@

export interface formatTimeOptions {
interface formatTimeOptions {
lang?: 'fr' | 'en';
format?: string | undefined;
valueNull?: boolean;
}
/**
*
*
* @param time The time in milliseconds to convert into any format

@@ -14,11 +13,29 @@ * @param options The options of the format returned

export interface parseTimeOptions {
msOff?: boolean;
interface parseTimeOptions {
msOff?: boolean;
}
/**
*
*
* @param time The time in string to convert in milliseconds or seconds
* @param options The options of the time returned
*/
export function parseTime(time: string, options?: parseTimeOptions): number;
export function parseTime(time: string, options?: parseTimeOptions): number;
interface formatDateOptions {
lang?: 'fr' | 'en';
format?: string | undefined;
}
/**
*
* @param {*} dateInMilliseconds The date in milliseconds to convert into any format
* @param {*} options The options of the format returned
*/
export function formatTime(dateInMilliseconds: number, options: formatDateOptions): string;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc