You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add to [JS Date.prototype](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)`.format()` method, allow format the object date in a readable form.
7
7
Call to method with the pattern you want and will return it formated.
8
+
9
+
> Date.format is based on [String.format](https://github.com/bifuer/String.format) > "Hello {name}!".format({name:"Homer"});
10
+
8
11
[npm](https://www.npmjs.com/package/date.format)
9
12
10
13
```javascript
@@ -39,8 +42,12 @@ console.log(date.format("UTC: Day {YY}/{MM}/{DD} at {hh}:{mm}:{ss} and {mss}ms",
39
42
+**h**: hour without leading zeros 0-23.**hh** hour 2 digits.
40
43
+**m**: minutes without leading zeros 0-59.**mm** minutes 2 digits.
41
44
+**s**: seconds without leading zeros 0-59.**ss** seconds 2 digits.
42
-
+**ms**: milliseconds without leading zeros 0-999.**mss** milliseconds 4 digits.
45
+
+**ms**: milliseconds without leading zeros 0-999.**mss** milliseconds 4 digits.
46
+
47
+
NEW:
43
48
49
+
+**tz**: Timezone difference between UTC and Local Time in minutes
50
+
+**tzh**: Timezone difference between UTC and Local Time in hours
44
51
45
52
## Licence
46
53
MIT
@@ -51,6 +58,9 @@ MIT
51
58
52
59
Añade a [Date.prototype de JS](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) el método `.format()`, permitiendo formatear el objeto date de una forma legible.
53
60
Especificamos al método el formato en el que devolverá el objeto date.
0 commit comments