When you simply use %DATE% or %TIME% in batch file/ command prompt, it will give you a string that matches the system's short format. However, some command, such as robocopy, will display date and time that matchs the system's long format. Is there any simple way to get date/time string in system's long format? Thanks.
For more detail, I am writing a batch file that will contain both hand-written date and time output, and output from command robocopy. I want them to be coherent for aesthetic reasons. So, let robocopy use the short format as date/time output is also an acceptable solution for me. I saw there are many answers on internet that tells how to convert one format to another. However, different computers have different format settings. So I do not perfer mannually convert but just pull string directly from system.
Intuitively, I tried %LONGDATE%, but it does not work without any suprise.