【问题标题】:Command to copy current time and date to clipboard in Windows 7在 Windows 7 中将当前时间和日期复制到剪贴板的命令
【发布时间】:2016-03-27 00:38:06
【问题描述】:

在 Windows 7 命令提示符下,我需要一个命令来将当前日期和时间复制到剪贴板。我用过

time /t & date /t | clip

但它只复制日期而不是时间。我该怎么办?

【问题讨论】:

    标签: clipboard piping windows-console


    【解决方案1】:
    echo %date%%time% | clip
    

    结果:星期一 03/28/2016 8:34:29.34

    【讨论】:

    • 在 Windows 10 上,这会产生输出 08-Feb-1923:30:39.07。在%date%%time% 之间添加一个空格来修复它。确切的输出可能取决于区域设置。
    【解决方案2】:

    时间 /t > timeanddate.txt
    日期 /t >> timeanddate.txt
    键入 timeanddate.txt |剪辑
    晚上 11 点 14 分
    2018 年 7 月 30 日星期一

    【讨论】:

      猜你喜欢
      • 2010-11-22
      • 2012-12-20
      • 2018-09-12
      • 1970-01-01
      • 1970-01-01
      • 2013-05-04
      • 1970-01-01
      • 2014-01-21
      • 2014-09-08
      相关资源
      最近更新 更多