C#服务器上怎么获取客户端当前时间(不用JS)

C#服务器上如何获取客户端当前时间(不用JS)
C#后台如何获取客户端当前时间,不使用JS

------解决方案--------------------
放个隐藏控件,在服务器端取
------解决方案--------------------
http协议头有一个Date域表示的是客户端发送请求的时间(GMT格式),应该是LZ想要的
http://blog.csdn.net/caojunling/article/details/1916899
------解决方案--------------------
仅当你要取得客户端的当地时间,才需要知道所在时区
如果你只需要知道相对于(服务器所在地)的同一时刻的北京时间则不需要,+8点就行
而且http协议里应该不会包含这类个人隐私信息,你说的通过IP也是一种办法(在SEO中常用来统计来访者所在区域),但有时候不可靠
------解决方案--------------------
5楼这个回复不严谨,会误导楼主.

HTTP Request-Header 中的 Date 这个字段并非是一定有的.并且可以说绝大部分时间不会包含这个字段

参考W3对于Header Field Definitions

14.18 Date
... ...
Clients SHOULD only send a Date header field in messages that include an entity-body, as in the case of the PUT and POST requests, and even then it is optional. A client without a clock MUST NOT send a Date header field in a request.
... ...

参考链接: 14 Header Field Definitions

to 楼主, 不使用JavaScript,无法保证获取到Client的时间.

引用:
http协议头有一个Date域表示的是客户端发送请求的时间(GMT格式),应该是LZ想要的
http://blog.csdn.net/caojunling/article/details/1916899

------解决方案--------------------
引用:
5楼这个回复不严谨,会误导楼主.

HTTP Request-Header 中的 Date 这个字段并非是一定有的.并且可以说绝大部分时间不会包含这个字段

参考W3对于Header Field Definitions

14.18 Date
... ...
Clients SHOULD only send a Date header field in messages that include an entity-body, as in the case of the PUT and POST requests, and even then it is optional. A client without a clock MUST NOT send a Date header field in a request.
... ...

参考链接: 14 Header Field Definitions

to 楼主, 不使用JavaScript,无法保证获取到Client的时间.

Quote: 引用:

http协议头有一个Date域表示的是客户端发送请求的时间(GMT格式),应该是LZ想要的
http://blog.csdn.net/caojunling/article/details/1916899


嗯,刚刚抓包看了一下,你说的没错
在客户端发送的Request请求里,没看到有Date字段
而在服务端返回的Response里,基本都有Date字段(按RFC上讲的,有3种情况例外:状态码100、503、没有有效时钟)
看来只有js取客户端时间了,简单省事