24 lines
672 B
HTML
24 lines
672 B
HTML
<html>
|
|
<div style="visibility: hidden">
|
|
<form id="form" method="POST" action="/">
|
|
<input name="timestamp" id="timestamp" type="number"></input>
|
|
<input name="timezone" id="timezone" type="text"></input>
|
|
</form>
|
|
</div>
|
|
</html>
|
|
<script>
|
|
window.onload = function(e){
|
|
var d = new Date();
|
|
var timestamp = Math.round(d.getTime() / 1000);
|
|
var timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
ts = document.getElementById("timestamp")
|
|
ts.value = timestamp;
|
|
tz = document.getElementById("timezone")
|
|
tz.value = timezone;
|
|
form = document.getElementById("form")
|
|
form.submit();
|
|
console.log(timestamp);
|
|
console.log(timezone);
|
|
}
|
|
</script>
|