开发者

JavaScript date format accepted by the date value returned from C#

开发者 https://www.devze.com 2022-12-26 16:55 出处:网络
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.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消