[2025-04-13] Send full time string in Javascript

This commit is contained in:
Andrew Conlin 2025-04-14 04:48:14 +09:00
parent 3c561b7975
commit b04e4b078a
2 changed files with 8 additions and 7 deletions

View file

@ -1,18 +1,18 @@
<html>
<div style="visibility: hidden">
<form id="form" method="POST" action="/">
<input name="timestamp" id="timestamp" type="number"></input>
<input name="date" id="date" type="text"></input>
</form>
</div>
</html>
<script>
window.onload = function(e){
var d = new Date();
var timestamp = Math.round(d.getTime() / 1000);
input = document.getElementById("timestamp")
input.value = timestamp;
var date = d.toUTCString();
dateform = document.getElementById("date")
dateform.value = date;
form = document.getElementById("form")
form.submit();
console.log(timestamp);
console.log(iso);
}
</script>