728x90
반응형
View단을 처리하다 보면
웹에서 서버시간을 가져와야 할 때가 있다. OTP로 2차인증을 할 경우?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Server date/time</title>
<script language="javascript" src="serverDate.js"></script>
</head>
<script language="javascript">
var localTime = new Date();
document.write("Local machine time is: " + localTime + "<br>");
document.write("Server time is: " + date);
</script>
<body>
</body>
d
https://gocoder.tistory.com/101
출처: https://gocoder.tistory.com/101 [고코더 IT Express]
JavaScript - 프론트에서 서버 시간 얻기
자바스크립트에서 서버 시간 가져오기 서버 시간을 가져오는건 당연히 서버 언어가 제공하는 기능을 사용하는게 정석입니다. 하지만 보안의 문제이거나 특별한 이유에서 프론트엔드로 서버시간을 제공해줄 수 없는..
gocoder.tistory.com
반응형
댓글