JavaScript 目次 - ray88’s diary
JavaScript Dateオブジェクト - ray88’s diary
JavaScript Dateオブジェクトの主なメンバー② - ray88’s diary
JavaScript Dateオブジェクト 日時の演算と複製 - ray88’s diary
分類 |
メンバー |
戻り値 |
説明 |
---|---|---|---|
メソッド |
getFullYear |
Integer |
「年」(4桁までの年)を返す |
getMonth() |
Integer |
「月」(0-11)を返す |
|
getDate() |
Integer |
「日」(1-31)を返す |
|
getDay() |
Integer |
「曜日」(0-6)を返す 日(0,)月(1,)火(2),水(3),木(4),金(5),土(6) |
|
getHours() |
Integer |
「時」(0-23)を返す |
|
getMinutes() |
Integer |
「分」(0-59)を返す |
|
getSeconds() |
Integer |
「秒」(0-59)を返す |
|
getMilliseconds() |
Integer |
「ミリ秒」(0-999)を返す |
|
getTime() |
Integer |
1970年1月1日00:00:00からの経過ミリ秒を返す |
|
getTimezoneOffset() |
Integer |
現地の時刻と協定世界時刻(UTC)との差を返す |
|
setFullYear(y) |
Integer |
「年」をy(4桁までの年)に設定する |
|
setMonth(m) |
Integer |
「月」をm(0-11)に設定する |
|
setDate(d) |
Integer |
「日」をd(1-31)に設定する |
|
setHours(h) |
Integer |
「時」をh(0-23)に設定する |
|
setMinutes(m) |
Integer |
「秒」をm(0-59)に設定する |
|
setMilliseconds(ms) |
Integer |
「ミリ秒」をms(0-999)に設定する |
|
setTimes(ts) |
Integer |
1970年1月1日00:00:00からの経過ミリ秒をtsに設定する |
|
toString() |
String |
日時を文字列に変換したものを返す |
|
toDateString() |
String |
日付部分を文字列に変換したものを返す |
|
toTimeString() |
String |
時刻部分を文字列に変換したものを返す |
|
toJSON() |
String |
日時をJSON文字列に変換したものを返す |