What is datecmd?

Incredibly, a simple and default command to print date and time in a desired format for the windows command prompt does not exists.

Realdate is a simple alternative to that, but it does not run on 64 bit machines. It was wrote in assembly, a complex language to extend such a tool (for me).

The 64 bit architecture is currently too common and the datecmd command was created for such demand.

Differences between datecmd and realdate

  • There are no CMOS date/hour switch /c
  • There are no /s switch too. You can use the desired format with /f. Eg: /f “Date/Time prefix: %Y”.
  • The format for /f is the ISO-C Standard of 1990 for the strftime function
  • Was written in C and builded with Visual C++ 2008
  • It is a little bit bigger

How to use?

datecmd [/f | /d | /t] /e /?]
       /f - format string (like strftime C function)
       /d - date only = /f="%Y%m%d"
       /t - time only = /f="%H%M%S"
       /e - add CR/LF (default: no EOL if /d, /t or /f specified)
       /? - display this help
       defaults: /f="%Y.%m.%d %H:%M:%S"

Download

Binary: https://github.com/thborges/datecmd/raw/master/Release/datecmd.exe
Sources: https://github.com/thborges/datecmd/

I found a bug. How to proceed?

Please provide the steps for reproduce the error or sugest a patch in GitHub.

Anúncios

2 comentários sobre “Get date/time for batch processing – DOS/cmd 64 bits compatible

Deixe um comentário

Preencha os seus dados abaixo ou clique em um ícone para log in:

Logotipo do WordPress.com

Você está comentando utilizando sua conta WordPress.com. Sair / Alterar )

Imagem do Twitter

Você está comentando utilizando sua conta Twitter. Sair / Alterar )

Foto do Facebook

Você está comentando utilizando sua conta Facebook. Sair / Alterar )

Foto do Google+

Você está comentando utilizando sua conta Google+. Sair / Alterar )

Conectando a %s