MCPcopy
hub / github.com/date-fns/date-fns / toTimeString

Method toTimeString

pkgs/tz/src/date/index.js:33–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31 }
32
33 toTimeString() {
34 // toUTCString returns RFC 7231 ("Mon, 12 Aug 2024 23:36:08 GMT")
35 const time = this.internal.toUTCString().split(" ")[4];
36 const [sign, hours, minutes] = this.tzComponents();
37 // "07:42:23 GMT+0800 (Singapore Standard Time)"
38 return `${time} GMT${sign}${hours}${minutes} (${tzName(
39 this.timeZone,
40 this,
41 )})`;
42 }
43
44 toLocaleString(locales, options) {
45 return Date.prototype.toLocaleString.call(this, locales, {

Callers 4

toStringMethod · 0.95
test.tsFile · 0.45
legacy.cjsFile · 0.45
tests.tsFile · 0.45

Calls 2

tzComponentsMethod · 0.95
tzNameFunction · 0.90

Tested by

no test coverage detected