设置时区下拉选择的值是客户端PC时区 [英] Set Timezone drop down selected value is Client PC timezone

查看:156
本文介绍了设置时区下拉选择的值是客户端PC时区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的网络应用程序中,我填写了一个包含Full Timezones的下拉列表。

在本页的页面加载中,我使用以下代码获取整个时区,TimeZoneInfo.GetSystemTimeZones()



正确填写下拉列表。

现在我想根据用户打开此页面来设置此下拉列表的默认值。

因此需要javascript方法来实现此功能。



使用了一些javascript方法但没有得到正确的结果。



var locdate = new Date();



这里locdate日期具有全部价值。 ':2014年3月31日星期一15:27:23 GMT + 0530(印度标准时间)'



但在某些时区如'E'非洲标准时间','E。欧洲标准时间'不是标准时间值。

,这也是在IE浏览器中只获得日期时间。

In my web application , I filled a dropdownlist with Whole Timezones.
In page load of this page I am used following code to get whole timezone, TimeZoneInfo.GetSystemTimeZones()

It is filling correctly in a dropdownlist.
Now I want to set default value of this dropdown based when user open this page .
So need javascript method to implement this thing.

Am used some javascript methods but not getting proper result.

var locdate = new Date();

here locdate date has full value. ':Mon Mar 31 2014 15:27:23 GMT+0530 (India Standard Time)'

But in some timezone like 'E. Africa Standard Time', 'E. Europe Standard Time' not standard time value.
and also this in IE browser only getting datetime .

推荐答案

你能不能试试这些链接,



http://www.prideparrot .com / blog / archive / 2011/9 / how_to_display_dates_and_times_in_clients_timezone [ ^ ]



http://runnable.com/UhKwAWqqRscRAADQ/retrieve-client-s-today-s-date-using-asp-net [ ^ ]



谢谢,

Hitesh Varde
Can you please try these links,

http://www.prideparrot.com/blog/archive/2011/9/how_to_display_dates_and_times_in_clients_timezone[^]

http://runnable.com/UhKwAWqqRscRAADQ/retrieve-client-s-today-s-date-using-asp-net[^]

Thanks,
Hitesh Varde


这篇关于设置时区下拉选择的值是客户端PC时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆