[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString [Back]  [Original]

Date.prototype.toTimeString() - JavaScript | MDN

MDN Web Docs

View in English Always switch to English

Date.prototype.toTimeString()

Baseline

20157

toTimeString() Date

const event = new Date("August 19, 1975 23:15:30");

console.log(event.toTimeString());
// : "23:15:30 GMT+0200 (CEST)"
// : 

js
toTimeString()

"Invalid Date"

Date toTimeString() HH:mm:ss GMTxxxx (TZ)

HH 2 0
mm 2 0
ss 2 0
xxxx - : 2 : 2 (e.g. -0500, +0800)
TZ PDT, PST

: "04:42:04 GMT+0000 (Coordinated Universal Time)".

toTimeString()

js
const d = new Date(0);

console.log(d.toString()); // "Thu Jan 01 1970 00:00:00 GMT+0000 (Coordinated Universal Time)"
console.log(d.toTimeString()); // "00:00:00 GMT+0000 (Coordinated Universal Time)"

ECMAScript 2027 LanguageSpecification
# sec-date.prototype.totimestring


Web Proxy Viewer  |  New URL  |  Original Page