0
comments mark
で入力タイプに設定するコードを試しました。 入力タイプを取得しようとしていますので、specific GMT
を追加できます。javascriptを使用してhtmlのinput = "time"に時間を配置する方法
<html>
<head>
<script language="JavaScript">
function calcTime(city, offset) {
d = new Date();
utc = d.getTime() + (d.getTimezoneOffset() * 60000);
nd = new Date(utc + (3600000*offset));
document.write("\n\t\n");
return "<br>"+"The local time in " + city + " is " + nd.toLocaleString()+ "<br>" ;
}
// get Singapore time
//document.write(calcTime('Singapore', '+8'));
//document.getElementById("tim").value = "(calcTime('Singapore', '+8'))";
//document.write("tim").value = (calcTime('Singapore', '+8'));
// get London time
//document.write("tim".value(calcTime('London', '+1')));
// I TRIES THE CODES^BUT IT IS NOT
document.write(calcTime('Moscow', '+3'));
</script>
</head>
<body>
<input type="time" name="tim" id="tim" value ="">
</body>
</html>
値=「夜十時53分05秒、次のように";しかしまだ入力されていないタイプ –
このスクリプトは 'body'の中に、'