Search code examples
clipboardpipingwindows-console

Command to copy current time and date to clipboard in Windows 7


In Windows 7 command prompt, I needed a command to copy current date and time to the clipboard. I used

time /t & date /t | clip

but it only copies the date and not the time. What should I do?


Solution

  • echo %date%%time% | clip
    

    result: Mon 03/28/2016 8:34:29.34