From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/api/notification/timestamp/index.html | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 files/ja/web/api/notification/timestamp/index.html (limited to 'files/ja/web/api/notification/timestamp') diff --git a/files/ja/web/api/notification/timestamp/index.html b/files/ja/web/api/notification/timestamp/index.html new file mode 100644 index 0000000000..770e410c00 --- /dev/null +++ b/files/ja/web/api/notification/timestamp/index.html @@ -0,0 +1,72 @@ +--- +title: Notification.timestamp +slug: Web/API/Notification/timestamp +tags: + - API + - Notification + - Notifications + - Notifications API + - Property + - Reference + - timeStamp + - プロパティ + - 通知 +translation_of: Web/API/Notification/timestamp +--- +

{{APIRef("Web Notifications")}}{{AvailableInWorkers}}{{securecontext_header}}

+ +

timestamp は {{domxref("Notification")}} インターフェイスの読取専用プロパティで、 {{domxref("Notification.Notification","Notification()")}} コンストラクターの timestamp オプションで指定された {{domxref("DOMTimeStamp")}} を返します。

+ +

通知のタイムスタンプは、 1970/01/01 00:00:00 UTC からの経過ミリ秒数で、通知が作成された時刻、または通知に関連づけたい任意のタイムスタンプを表します。例えば、予定されている会議のタイムスタンプは未来に設定することができ、一方、見逃したメッセージのタイムスタンプは過去に設定することができます。

+ +

構文

+ +
var timestamp = Notification.timestamp;
+ +

+ +

{{domxref("DOMTimeStamp")}} です。

+ +

+ +

次のスニペットは通知を発行します。単純な options オブジェクトが生成され、通知が Notification() コンストラクターを使用して発行されます。

+ +
var dts = Math.floor(Date.now());
+
+var options = {
+  body: 'Do you like my body?',
+  timestamp: dts
+}
+
+var n = new Notification('Test notification',options);
+
+console.log(n.timestamp) // should log original timestamp
+ +

仕様書

+ + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('Web Notifications','#dom-notification-timestamp','timestamp')}}{{Spec2('Web Notifications')}}Living standard
+ +

ブラウザーの互換性

+ + + +

{{Compat("api.Notification.timestamp")}}

+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf