使用NET TIME获取包括毫秒的时间 [英] Get time including milliseconds using NET TIME

查看:189
本文介绍了使用NET TIME获取包括毫秒的时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用命令提示符,我输入了以下命令:

- > NET时间



它返回给我以下消息:

当前时间......是2:09:45 PM

命令成功完成。



从上面的消息中可以看出,时间没有毫秒。如何使用相同的命令包括毫秒:NET TIME?



仅供参考,我将使用以下C#代码来检索上述结果:

Hi, I am using command prompt and I entered the following command:
--> NET TIME

It returned me the following message:
Current time at......is 2:09:45 PM
The command completed successfully.

As from the message above, the time do not have milliseconds. How can I include also the milliseconds using the same command: NET TIME ?

FYI, I will have the following C# codes to retrieve the above result:

using (Process p = new Process())
        {
         p.StartInfo.UseShellExecute = false;
         p.StartInfo.RedirectStandardOutput = true;
         p.StartInfo.CreateNoWindow = true;
         p.StartInfo.FileName = ConstantReference.General.Net;
         p.StartInfo.Arguments = @value;
         p.Start();
         p.WaitForExit();
         string output = p.StandardOutput.ReadToEnd(); //result here
        }





从上面的字符串输出,它没有毫秒,我怎么能让它有毫秒?我试图从互联网资源搜索,但我找不到答案。

任何输入都表示赞赏。谢谢。



From the string output above, it do not have milliseconds, how can I make it to have milliseconds? I have tried to search from Internet resources but I can't find the answer.
Any input is appreciated. Thank you.

推荐答案

你不能......

NET TIME用于将你的计算机时钟与时间服务器同步(没有附加参数它将是DC),在二进制级别上完成同步,但您无法控制显示的值...
You can not...
NET TIME used to synchronize your computer's clock with a time server (without additional parameters it will be the DC), that synchronization done on the binary level, but you have no control over the displayed value...


这篇关于使用NET TIME获取包括毫秒的时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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