Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Formatted DATE output

Sami SAHIN
2012-10-09
2013-01-06
  • Sami SAHIN
    Sami SAHIN
    2012-10-09

    I think that DOS Command line has a major problem for getting formatted DATE output. It is totally dependent of the regional settings of the machine. To use formatted day, month, year, hour, minute, second or milisecond values in batch script is possible, but the batch file is not portable between different regional settings.

    So creating a line in a batch script like the one below can solve the problem temporarily and only in that regional zone which the OS is operating under.

    set today=%date:~10,4%-%date:~4,2%-%date:~-7,2%

    I hoped that SFK is able to overcome this simple problem but I see that it hasn't got any formatted date output functions. It would be great if it had a function to get formatted date output.

     
  • stahlworks
    stahlworks
    2012-10-09

    You may try

    sfk time -h
    

    and give feedback if it is useful.
    It's an inofficial function so far, and the syntax may change.