diff options
| author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:52 -0500 |
|---|---|---|
| committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:52 -0500 |
| commit | 074785cea106179cb3305637055ab0a009ca74f2 (patch) | |
| tree | e6ae371cccd642aa2b67f39752a2cdf1fd4eb040 /files/pt-br/web/javascript/reference/global_objects/date/togmtstring | |
| parent | da78a9e329e272dedb2400b79a3bdeebff387d47 (diff) | |
| download | translated-content-074785cea106179cb3305637055ab0a009ca74f2.tar.gz translated-content-074785cea106179cb3305637055ab0a009ca74f2.tar.bz2 translated-content-074785cea106179cb3305637055ab0a009ca74f2.zip | |
initial commit
Diffstat (limited to 'files/pt-br/web/javascript/reference/global_objects/date/togmtstring')
| -rw-r--r-- | files/pt-br/web/javascript/reference/global_objects/date/togmtstring/index.html | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/files/pt-br/web/javascript/reference/global_objects/date/togmtstring/index.html b/files/pt-br/web/javascript/reference/global_objects/date/togmtstring/index.html new file mode 100644 index 0000000000..1df4801950 --- /dev/null +++ b/files/pt-br/web/javascript/reference/global_objects/date/togmtstring/index.html @@ -0,0 +1,70 @@ +--- +title: Date.prototype.toGMTString() +slug: Web/JavaScript/Reference/Global_Objects/Date/toGMTString +tags: + - Date + - Deprecated + - Depreciado + - JavaScript + - Method + - Prototipo + - Prototype + - Referencia + - data + - metodo +translation_of: Web/JavaScript/Reference/Global_Objects/Date/toGMTString +--- +<div>{{JSRef}} {{deprecated_header}}</div> + +<p>O método <strong><code>toGMTString()</code></strong> converte a data para uma cadeia de caracteres (<em>string)</em>, usando as convenções de Internet para o Horário de Greenwich (GMT). O formato exato do valor retornado por <code>toGMTString()</code> varia de acordo com plataforma e navegador, em geral ele deve representar uma <em>string</em> legível para um ser humano.</p> + +<div class="note"> +<p><strong>Nota:</strong> <code>toGMTString()</code> está depreciado e não deve ser mais usado. Ele se mantém implementado somente para retrocompatibilidade; por favor use {{jsxref("Date.prototype.toUTCString()", "toUTCString()")}}.</p> +</div> + +<h2 id="Sintaxe">Sintaxe</h2> + +<pre class="syntaxbox notranslate"><code><var>dateObj</var>.toGMTString()</code></pre> + +<h3 id="Valor_de_retorno">Valor de retorno</h3> + +<p>Uma <em>string</em> representando a data seguindo a convenção de Internet para o Horário de Greenwich (GMT).</p> + +<h2 id="Exemplos">Exemplos</h2> + +<h3 id="Simple_example">Simple example</h3> + +<p>Neste exemplo, o método <code>toGMTString()</code> converte a data para GMT (UTC) usando o deslocamento de fuso horário do sistema operacional e retorna uma <em>string </em>que é similar a seguinta forma. O formato exato depende da plataforma.</p> + +<pre class="brush: js notranslate">var today = new Date(); +var str = today.toGMTString(); // depreciado! use toUTCString() + +console.log(str); // Mon, 18 Dec 1995 17:28:35 GMT +</pre> + +<h2 id="Especificações">Especificações</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Especificação</th> + </tr> + <tr> + <td>{{SpecName('ESDraft', '#sec-date.prototype.togmtstring', 'Date.prototype.toGMTString')}}</td> + </tr> + </tbody> +</table> + +<h2 id="Compatibilidade_de_navegador">Compatibilidade de navegador</h2> + +<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p> + +<p>{{Compat("javascript.builtins.Date.toGMTString")}}</p> + +<h2 id="Veja_também">Veja também</h2> + +<ul> + <li>{{jsxref("Date.prototype.toLocaleDateString()")}}</li> + <li>{{jsxref("Date.prototype.toTimeString()")}}</li> + <li>{{jsxref("Date.prototype.toUTCString()")}}</li> +</ul> |
