Any one help to to get the extact value from the JavaScript date time开发者_如何学C utc format. I am using a C# web method which is returning a date and I have to set that date with Timezone.
Thanks
Please check the code below:
<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
精彩评论