任何人都可以帮助从JavaScript日期时间utc格式中获取确切的值。我正在使用一个返回日期的C#web方法,我必须使用Timezone设置该日期。谢谢
答案 0 :(得分:1)
请检查以下代码:
<script language="javascript">
ourDate = new Date();
document.write("The time and date at your computer's location is: "
+ ourDate.toLocaleString()
+ ".<br/>");
document.write("The time zone offset between local time and GMT is "
+ ourDate.getTimezoneOffset()
+ " minutes.<br/>");
document.write("The time and date (GMT) is: "
+ ourDate.toGMTString()
+ ".<br/>");
</script>
HTH