| 1 |
<!DOCTYPE html> |
| 2 |
<html lang="en-au"> |
| 3 |
<head> |
| 4 |
<title>Timezone Tests</title> |
| 5 |
<script> |
| 6 |
let originDate = new Date(parseInt(new URL(document.location.href).hash.replace(/^#/, "").concat('000'))); |
| 7 |
</script> |
| 8 |
</head> |
| 9 |
<body> |
| 10 |
<p id="locale"><script>document.write(new Intl.DateTimeFormat().resolvedOptions().locale)</script></p> |
| 11 |
<p id="unixTime"><script>document.write(new Date(originDate).getTime() / 1000)</script></p> |
| 12 |
<p id="toString"><script>document.write(new Date(originDate).toString())</script></p> |
| 13 |
<p id="toLocaleString"><script>document.write(new Date(originDate).toLocaleString())</script></p> |
| 14 |
<p id="toLocaleFormat"><script>if ("toLocaleFormat" in Date) { document.write(new Date(originDate).toLocaleFormat()) }</script></p> |
| 15 |
<p id="getDate"><script>document.write(new Date(originDate).getDate())</script></p> |
| 16 |
<p id="getDay"><script>document.write(new Date(originDate).getDay())</script></p> |
| 17 |
<p id="getMonth"><script>document.write(new Date(originDate).getMonth())</script></p> |
| 18 |
<p id="getFullYear"><script>document.write(new Date(originDate).getFullYear())</script></p> |
| 19 |
<p id="getHours"><script>document.write(new Date(originDate).getHours())</script></p> |
| 20 |
<p id="getMinutes"><script>document.write(new Date(originDate).getMinutes())</script></p> |
| 21 |
<p id="getSeconds"><script>document.write(new Date(originDate).getSeconds())</script></p> |
| 22 |
<p id="Collator"><script>document.write(new Intl.Collator(undefined, { sensitivity: "base" }).resolvedOptions().locale)</script></p> |
| 23 |
<p id="DisplayNames"><script>document.write(new Intl.DisplayNames(undefined, { type: "region"}).resolvedOptions().locale)</script></p> |
| 24 |
<p id="DurationFormat"><script>if ("DurationFormat" in Intl) { document.write(new Intl.DurationFormat(undefined, { style: "long" }).resolvedOptions().locale) }</script></p> |
| 25 |
<p id="ListFormat"><script>document.write(new Intl.ListFormat(undefined, { style: "long", type: "conjunction" }).resolvedOptions().locale)</script></p> |
| 26 |
<p id="NumberFormat"><script>document.write(new Intl.NumberFormat(undefined).resolvedOptions().locale)</script></p> |
| 27 |
<p id="PluralRules"><script>document.write(new Intl.PluralRules(undefined).resolvedOptions().locale)</script></p> |
| 28 |
<p id="RelativeTimeFormat"><script>document.write(new Intl.RelativeTimeFormat(undefined, { style: 'short' }).resolvedOptions().locale)</script></p> |
| 29 |
<p id="Segmenter"><script>document.write(new Intl.Segmenter(undefined, { granularity: 'word' }).resolvedOptions().locale)</script></p> |
| 30 |
<iframe id="sandbox" sandbox="allow-same-origin" style="display:none"> |
| 31 |
</iframe> |
| 32 |
<script> |
| 33 |
var iframe = document.getElementById("sandbox").contentWindow; |
| 34 |
</script> |
| 35 |
<p id="iframe_locale"><script>document.write(new iframe.Intl.DateTimeFormat().resolvedOptions().locale)</script></p> |
| 36 |
<p id="iframe_unixTime"><script>document.write(new iframe.Date(originDate).getTime() / 1000)</script></p> |
| 37 |
<p id="iframe_toString"><script>document.write(new iframe.Date(originDate).toString())</script></p> |
| 38 |
<p id="iframe_toLocaleString"><script>document.write(new iframe.Date(originDate).toLocaleString())</script></p> |
| 39 |
<p id="iframe_toLocaleFormat"><script>if ("toLocaleFormat" in iframe.Date) { document.write(new iframe.Date(originDate).toLocaleFormat()) }</script></p> |
| 40 |
<p id="iframe_getDate"><script>document.write(new iframe.Date(originDate).getDate())</script></p> |
| 41 |
<p id="iframe_getDay"><script>document.write(new iframe.Date(originDate).getDay())</script></p> |
| 42 |
<p id="iframe_getMonth"><script>document.write(new iframe.Date(originDate).getMonth())</script></p> |
| 43 |
<p id="iframe_getFullYear"><script>document.write(new iframe.Date(originDate).getFullYear())</script></p> |
| 44 |
<p id="iframe_getHours"><script>document.write(new iframe.Date(originDate).getHours())</script></p> |
| 45 |
<p id="iframe_getMinutes"><script>document.write(new iframe.Date(originDate).getMinutes())</script></p> |
| 46 |
<p id="iframe_getSeconds"><script>document.write(new iframe.Date(originDate).getSeconds())</script></p> |
| 47 |
<p id="iframe_Collator"><script>document.write(new Intl.Collator(undefined, { sensitivity: "base" }).resolvedOptions().locale)</script></p> |
| 48 |
<p id="iframe_DisplayNames"><script>document.write(new Intl.DisplayNames(undefined, { type: "region"}).resolvedOptions().locale)</script></p> |
| 49 |
<p id="iframe_DurationFormat"><script>if ("DurationFormat" in Intl) { document.write(new Intl.DurationFormat(undefined, { style: "long" }).resolvedOptions().locale) }</script></p> |
| 50 |
<p id="iframe_ListFormat"><script>document.write(new Intl.ListFormat(undefined, { style: "long", type: "conjunction" }).resolvedOptions().locale)</script></p> |
| 51 |
<p id="iframe_NumberFormat"><script>document.write(new Intl.NumberFormat(undefined).resolvedOptions().locale)</script></p> |
| 52 |
<p id="iframe_PluralRules"><script>document.write(new Intl.PluralRules(undefined).resolvedOptions().locale)</script></p> |
| 53 |
<p id="iframe_RelativeTimeFormat"><script>document.write(new Intl.RelativeTimeFormat(undefined, { style: 'short' }).resolvedOptions().locale)</script></p> |
| 54 |
<p id="iframe_Segmenter"><script>document.write(new Intl.Segmenter(undefined, { granularity: 'word' }).resolvedOptions().locale)</script></p> |
| 55 |
</body> |
| 56 |
</html> |