简体   繁体   English

如何从Windows终端向服务器询问日期?

[英]How to ask the date to a server from windows terminal?

For example, if I want to know if I am connected I can use: 例如,如果我想知道是否已连接,可以使用:

ping 8.8.8.8

to send a ping to google DNS server. 将ping发送到Google DNS服务器。 Can I ask in a similar way the date of a server? 我可以用类似的方式询问服务器的日期吗? Something like: 就像是:

give_me_your_date 8.8.8.8

if you had curl you could 如果你有卷曲,你可以

 curl -I http://example.com HTTP/1.1 200 OK Date: Sun, 16 Oct 2016 23:37:15 GMT Server: Apache/2.4.23 (Unix) X-Powered-By: PHP/5.6.24 Connection: close Content-Type: text/html; charset=UTF-8 

and you if that server is a webserver you would get an http header which you can retrieve the date from 如果该服务器是网络服务器,则将获得一个http标头,您可以从该标头中检索日期

you can get curl for windows here https://curl.haxx.se/download.html 您可以在此处卷曲Windows https://curl.haxx.se/download.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM