Create a time object based on an ISO 8601 date-time string (e.g. ‘2013-01-01T01:01:01+00:00’). RethinkDB supports all valid ISO 8601 formats except for week dates. Read more about the ISO 8601 format at Wikipedia. Show
If you pass an ISO 8601 string without a time zone, you must specify the time zone with the The date.toISOString() method is used to convert the given date object’s contents into a string in ISO format (ISO 8601) i.e, in the form of (YYYY-MM-DDTHH:mm:ss.sssZ or ±YYYYYY-MM-DDTHH:mm:ss.sssZ).The date object is created using date() constructor. Syntax: dateObj.toISOString() Parameters: This method does not take any parameter. It is just used along with a Date object created using Date() constructor. Return Values: It returns the converted string of Date() constructor contents into ISO format (ISO 8601). Note: The DateObj is a valid Date object created using Date()constructor. Below is the example of Date toISOString() method. Example 1: javascript
1996-10-15T00:05:32.000Z0 1996-10-15T00:05:32.000Z1 1996-10-15T00:05:32.000Z2 1996-10-15T00:05:32.000Z3 1996-10-15T00:05:32.000Z4
1996-10-15T00:05:32.000Z6 1996-10-15T00:05:32.000Z2 1996-10-15T00:05:32.000Z8 1996-10-15T00:05:32.000Z9 Output: 1996-10-15T00:05:32.000Z Example 2: Here nothing as a parameter is passed while creating date object but still toISOString() method return current day name, month name, date, year, and time. javascript2018-04-23T10:26:00.996Z0
2018-04-23T10:26:00.996Z3 new 2018-04-23T10:26:00.996Z5 1996-10-15T00:05:32.000Z2 2018-04-23T10:26:00.996Z7 2018-04-23T10:26:00.996Z8
1996-10-15T00:05:32.000Z6 1996-10-15T00:05:32.000Z2 1996-10-15T00:05:32.000Z8 1996-10-15T00:05:32.000Z9 Output: 2018-04-23T10:26:00.996Z Example 3: Here we will pass a date object toISOString() method return day name, month name, date, year, and time. javascript2018-04-23T10:26:00.996Z0
1996-10-15T00:05:32.000Z1 1996-10-15T00:05:32.000Z2 2018-04-23T10:26:00.996Z7 2018-04-23T10:26:00.996Z8
1996-10-15T00:05:32.000Z6 1996-10-15T00:05:32.000Z2 1996-10-15T00:05:32.000Z8 1996-10-15T00:05:32.000Z9 Output: 1996-10-13T08:35:32.000Z Note: Months, Dates, hours, minutes, seconds, and milliseconds should all be in their respective range of 0 to 11, 1 to 31, 0 to 23, 0 to 59, 0 to 59, 0 to 999 respectively. We have a complete list of Javascript Date Objects, to check those please go through this Javascript Date Object Complete reference article. Supported Browsers: The browsers supported by JavaScript Date toISOString() method are listed below:
We have a Cheat Sheet on Javascript where we covered all the important topics of Javascript to check those please go through Javascript Cheat Sheet-A Basic guide to JavaScript. Dengan menambahkan data terstruktur <html> <head> <title>Title of a News Article</title> </head> <body> <div itemscope itemtype="https://schema.org/NewsArticle"> <div itemprop="headline">Title of News Article</div> <meta itemprop="image" content="https://example.com/photos/1x1/photo.jpg" /> <meta itemprop="image" content="https://example.com/photos/4x3/photo.jpg" /> <img itemprop="image" src="https://example.com/photos/16x9/photo.jpg" /> <div> <span itemprop="datePublished" content="2015-02-05T08:00:00+08:00"> February 5, 2015 at 8:00am </span> (last modified <span itemprop="dateModified" content="2015-02-05T09:20:00+08:00"> February 5, 2015 at 9:20am </span> ) </div> <div> by <span itemprop="author" itemscope itemtype="https://schema.org/Person"> <a itemprop="url" href="https://example.com/profile/janedoe123"> <span itemprop="name">Jane Doe</span> </a> </span> and <span itemprop="author" itemscope itemtype="https://schema.org/Person"> <a itemprop="url" href="https://example.com/profile/johndoe123"> <span itemprop="name">John Doe</span> </a> </span> </div> </div> </body> </html>0 ke halaman artikel berita, blog, dan olahraga, Anda dapat membantu Google lebih memahami halaman web serta menampilkan teks judul, gambar, dan informasi tanggal dengan lebih baik untuk artikel di hasil penelusuran di Google Penelusuran dan properti lainnya (misalnya, Google Berita dan Asisten Google). Meskipun tidak ada persyaratan markup yang perlu dipenuhi untuk menggunakan fitur Google Berita seperti Berita utama, Anda dapat menambahkan <html> <head> <title>Title of a News Article</title> </head> <body> <div itemscope itemtype="https://schema.org/NewsArticle"> <div itemprop="headline">Title of News Article</div> <meta itemprop="image" content="https://example.com/photos/1x1/photo.jpg" /> <meta itemprop="image" content="https://example.com/photos/4x3/photo.jpg" /> <img itemprop="image" src="https://example.com/photos/16x9/photo.jpg" /> <div> <span itemprop="datePublished" content="2015-02-05T08:00:00+08:00"> February 5, 2015 at 8:00am </span> (last modified <span itemprop="dateModified" content="2015-02-05T09:20:00+08:00"> February 5, 2015 at 9:20am </span> ) </div> <div> by <span itemprop="author" itemscope itemtype="https://schema.org/Person"> <a itemprop="url" href="https://example.com/profile/janedoe123"> <span itemprop="name">Jane Doe</span> </a> </span> and <span itemprop="author" itemscope itemtype="https://schema.org/Person"> <a itemprop="url" href="https://example.com/profile/johndoe123"> <span itemprop="name">John Doe</span> </a> </span> </div> </div> </body> </html>0 untuk memberi tahu Google secara lebih eksplisit tentang konten Anda (misalnya, bahwa itu merupakan artikel berita, siapa penulisnya, atau apa judulnya). ContohBerikut contoh halaman dengan data terstruktur <html> <head> <title>Title of a News Article</title> </head> <body> <div itemscope itemtype="https://schema.org/NewsArticle"> <div itemprop="headline">Title of News Article</div> <meta itemprop="image" content="https://example.com/photos/1x1/photo.jpg" /> <meta itemprop="image" content="https://example.com/photos/4x3/photo.jpg" /> <img itemprop="image" src="https://example.com/photos/16x9/photo.jpg" /> <div> <span itemprop="datePublished" content="2015-02-05T08:00:00+08:00"> February 5, 2015 at 8:00am </span> (last modified <span itemprop="dateModified" content="2015-02-05T09:20:00+08:00"> February 5, 2015 at 9:20am </span> ) </div> <div> by <span itemprop="author" itemscope itemtype="https://schema.org/Person"> <a itemprop="url" href="https://example.com/profile/janedoe123"> <span itemprop="name">Jane Doe</span> </a> </span> and <span itemprop="author" itemscope itemtype="https://schema.org/Person"> <a itemprop="url" href="https://example.com/profile/johndoe123"> <span itemprop="name">John Doe</span> </a> </span> </div> </div> </body> </html>0.
Cara menambahkan data terstrukturData terstruktur adalah format terstandarisasi untuk memberikan informasi tentang suatu halaman dan mengelompokkan konten halaman tersebut. Jika Anda baru mengenal data terstruktur, Anda dapat mempelajari lebih lanjut cara kerja data terstruktur. Berikut adalah ringkasan tentang cara membuat, menguji, dan merilis data terstruktur. Untuk panduan langkah demi langkah tentang cara menambahkan data terstruktur ke halaman web, lihat codelab data terstruktur.
PedomanAnda harus mengikuti panduan ini agar data terstruktur memenuhi syarat untuk disertakan dalam hasil Google Penelusuran. Peringatan: Jika situs Anda melanggar satu atau beberapa panduan ini, Google dapat melakukan tindakan manual terhadap situs tersebut. Setelah menyelesaikan masalahnya, Anda dapat mengirimkan situs Anda agar dipertimbangkan ulang.
Panduan teknis
Definisi jenis data terstrukturUntuk membantu Google memahami halaman Anda dengan lebih baik, sertakan sebanyak mungkin properti yang direkomendasikan yang berlaku untuk halaman web Anda. Tidak ada properti yang sifatnya wajib; tambahkan properti yang berlaku untuk konten Anda. Objek <html> <head> <title>Title of a News Article</title> </head> <body> <div itemscope itemtype="https://schema.org/NewsArticle"> <div itemprop="headline">Title of News Article</div> <meta itemprop="image" content="https://example.com/photos/1x1/photo.jpg" /> <meta itemprop="image" content="https://example.com/photos/4x3/photo.jpg" /> <img itemprop="image" src="https://example.com/photos/16x9/photo.jpg" /> <div> <span itemprop="datePublished" content="2015-02-05T08:00:00+08:00"> February 5, 2015 at 8:00am </span> (last modified <span itemprop="dateModified" content="2015-02-05T09:20:00+08:00"> February 5, 2015 at 9:20am </span> ) </div> <div> by <span itemprop="author" itemscope itemtype="https://schema.org/Person"> <a itemprop="url" href="https://example.com/profile/janedoe123"> <span itemprop="name">Jane Doe</span> </a> </span> and <span itemprop="author" itemscope itemtype="https://schema.org/Person"> <a itemprop="url" href="https://example.com/profile/johndoe123"> <span itemprop="name">John Doe</span> </a> </span> </div> </div> </body> </html>0Objek Article harus didasarkan pada salah satu jenis schema.org berikut: <html> <head> <title>Title of a News Article</title> </head> <body> <div itemscope itemtype="https://schema.org/NewsArticle"> <div itemprop="headline">Title of News Article</div> <meta itemprop="image" content="https://example.com/photos/1x1/photo.jpg" /> <meta itemprop="image" content="https://example.com/photos/4x3/photo.jpg" /> <img itemprop="image" src="https://example.com/photos/16x9/photo.jpg" /> <div> <span itemprop="datePublished" content="2015-02-05T08:00:00+08:00"> February 5, 2015 at 8:00am </span> (last modified <span itemprop="dateModified" content="2015-02-05T09:20:00+08:00"> February 5, 2015 at 9:20am </span> ) </div> <div> by <span itemprop="author" itemscope itemtype="https://schema.org/Person"> <a itemprop="url" href="https://example.com/profile/janedoe123"> <span itemprop="name">Jane Doe</span> </a> </span> and <span itemprop="author" itemscope itemtype="https://schema.org/Person"> <a itemprop="url" href="https://example.com/profile/johndoe123"> <span itemprop="name">John Doe</span> </a> </span> </div> </div> </body> </html>0, <html> <head> <title>Title of a News Article</title> </head> <body> <div itemscope itemtype="https://schema.org/NewsArticle"> <div itemprop="headline">Title of News Article</div> <meta itemprop="image" content="https://example.com/photos/1x1/photo.jpg" /> <meta itemprop="image" content="https://example.com/photos/4x3/photo.jpg" /> <img itemprop="image" src="https://example.com/photos/16x9/photo.jpg" /> <div> <span itemprop="datePublished" content="2015-02-05T08:00:00+08:00"> February 5, 2015 at 8:00am </span> (last modified <span itemprop="dateModified" content="2015-02-05T09:20:00+08:00"> February 5, 2015 at 9:20am </span> ) </div> <div> by <span itemprop="author" itemscope itemtype="https://schema.org/Person"> <a itemprop="url" href="https://example.com/profile/janedoe123"> <span itemprop="name">Jane Doe</span> </a> </span> and <span itemprop="author" itemscope itemtype="https://schema.org/Person"> <a itemprop="url" href="https://example.com/profile/johndoe123"> <span itemprop="name">John Doe</span> </a> </span> </div> </div> </body> </html>1, <html> <head> <title>Title of a News Article</title> </head> <body> <div itemscope itemtype="https://schema.org/NewsArticle"> <div itemprop="headline">Title of News Article</div> <meta itemprop="image" content="https://example.com/photos/1x1/photo.jpg" /> <meta itemprop="image" content="https://example.com/photos/4x3/photo.jpg" /> <img itemprop="image" src="https://example.com/photos/16x9/photo.jpg" /> <div> <span itemprop="datePublished" content="2015-02-05T08:00:00+08:00"> February 5, 2015 at 8:00am </span> (last modified <span itemprop="dateModified" content="2015-02-05T09:20:00+08:00"> February 5, 2015 at 9:20am </span> ) </div> <div> by <span itemprop="author" itemscope itemtype="https://schema.org/Person"> <a itemprop="url" href="https://example.com/profile/janedoe123"> <span itemprop="name">Jane Doe</span> </a> </span> and <span itemprop="author" itemscope itemtype="https://schema.org/Person"> <a itemprop="url" href="https://example.com/profile/johndoe123"> <span itemprop="name">John Doe</span> </a> </span> </div> </div> </body> </html>2.Properti yang direkomendasikan "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ]2 "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ]3 atau "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ]4 Penulis artikel. Untuk membantu Google memahami penulis secara optimal di berbagai fitur, sebaiknya ikuti . "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ]5 "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ]6 Nama penulis. "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ]7 "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ]8 Link ke halaman web yang mengidentifikasi penulis artikel secara unik. Misalnya, halaman media sosial penulis, halaman tentang saya, atau halaman biodata. Anda dapat menggunakan properti"image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ]9 sebagai alternatif. Google dapat memahami "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ]9 dan { "@context": "https://schema.org", "@type": "NewsArticle", "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ] }1 saat membedakan penulis. { "@context": "https://schema.org", "@type": "NewsArticle", "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ] }2 { "@context": "https://schema.org", "@type": "NewsArticle", "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ] }3 Tanggal dan waktu artikel terakhir kali diubah, dalam format ISO 8601. Tambahkan properti { "@context": "https://schema.org", "@type": "NewsArticle", "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ] }2 jika Anda ingin memberikan informasi tanggal yang lebih akurat ke Google. Pengujian Hasil Kaya tidak menampilkan peringatan untuk properti ini, yang hanya direkomendasikan jika Anda memutuskan bahwa properti tersebut berlaku untuk situs Anda. { "@context": "https://schema.org", "@type": "NewsArticle", "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ] }5 { "@context": "https://schema.org", "@type": "NewsArticle", "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ] }3 Tanggal dan waktu artikel pertama kali dipublikasikan, dalam format ISO 8601. Tambahkan properti { "@context": "https://schema.org", "@type": "NewsArticle", "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ] }5 jika Anda ingin memberikan informasi tanggal yang lebih akurat ke Google. Pengujian Hasil Kaya tidak menampilkan peringatan untuk properti ini, yang hanya direkomendasikan jika Anda memutuskan bahwa properti tersebut berlaku untuk situs Anda. { "@context": "https://schema.org", "@type": "NewsArticle", "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ] }8 "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ]6 Judul artikel. Pertimbangkan untuk menggunakan judul yang ringkas, karena judul yang panjang mungkin akan terpotong di beberapa perangkat. "author": [ {"name": "Willow Lane"}, {"name": "Regula Felix"} ]0 "author": [ {"name": "Willow Lane"}, {"name": "Regula Felix"} ]1 atau "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ]8 berulang URL ke gambar yang mewakili artikel. Gunakan gambar yang relevan dengan artikel, bukan logo atau teks. Pedoman gambar tambahan:
Contoh: "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ] Contoh: { "@context": "https://schema.org", "@type": "NewsArticle", "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ] } Praktik terbaik markup penulisUntuk membantu Google memahami dan menampilkan penulis konten secara optimal, sebaiknya ikuti praktik terbaik ini saat mencantumkan penulis di markup: Praktik terbaik untuk markup penulisMenyertakan semua penulis di markupPastikan semua penulis yang ditampilkan sebagai penulis di halaman web juga disertakan dalam markup. Mencantumkan beberapa penulisSaat mencantumkan beberapa penulis, cantumkan setiap penulis di kolom "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ]2 masing-masing: "author": [ {"name": "Willow Lane"}, {"name": "Regula Felix"} ] Jangan gabungkan beberapa penulis di kolom "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ]2 yang sama: "author": { "name": "Willow Lane, Regula Felix" } Menggunakan kolom tambahanUntuk membantu Google lebih memahami siapa penulisnya, sebaiknya gunakan properti "author": [ {"name": "Willow Lane"}, {"name": "Regula Felix"} ]5 dan { "@context": "https://schema.org", "@type": "NewsArticle", "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ] }1 (atau "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ]9). Gunakan URL yang valid untuk properti { "@context": "https://schema.org", "@type": "NewsArticle", "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ] }1 atau "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ]9. Misalnya, jika penulisnya adalah orang, Anda dapat menautkan ke halaman penulis yang menyediakan informasi selengkapnya tentang penulis: "author": [ { "@type": "Person", "name": "Willow Lane", "url": "https://www.example.com/staff/willow_lane" } ] Jika penulisnya adalah sebuah organisasi, Anda dapat menautkan ke halaman beranda organisasi. "author": [ { "@type":"Organization", "name": "Some News Agency", "url": "https://www.example.com/" } ] Hanya mencantumkan nama penulis di properti "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ]5Di properti "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ]5, hanya cantumkan nama penulis. Jangan tambahkan informasi lain apa pun. Khususnya, jangan tambahkan informasi berikut:
"author": [ { "name": "Echidna Jones", "honorificPrefix": "Dr", "jobTitle": "Editor in Chief" } ], "publisher": [ { "name": "Bugs Daily" } ] } Menggunakan "author": { "name": "Willow Lane, Regula Felix" }6 yang sesuaiGunakan jenis "author": { "name": "Willow Lane, Regula Felix" }7 untuk orang, dan jenis "author": { "name": "Willow Lane, Regula Felix" }8 untuk organisasi. Jangan gunakan jenis "author": { "name": "Willow Lane, Regula Felix" }9, dan jangan gunakan jenis yang salah (misalnya, menggunakan jenis "author": { "name": "Willow Lane, Regula Felix" }8 untuk orang). Berikut adalah contoh yang menerapkan praktik terbaik markup penulis: "author": [ { "@type": "Person", "name": "Willow Lane", "jobTitle": "Journalist", "url":"https://www.example.com/staff/willow-lane" }, { "@type":"Person", "name": "Echidna Jones", "jobTitle": "Editor in Chief", "url":"https://www.example.com/staff/echidna-jones" } ], "publisher": { "name": "The Daily Bug", "url": "https://www.example.com" }, // + Other fields related to the article... } Pemecahan masalahJika Anda mengalami masalah saat menerapkan atau mendebug data terstruktur, berikut beberapa referensi yang dapat membantu Anda. |