Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

How to format the date in DOS

  • 01-07-2004 10:31am
    #1
    Closed Accounts Posts: 2,585 ✭✭✭


    When I type the "date /t" command, DOS returns 01/07/2004.

    I want to use this date to create a directory in a DOS script so I need it in the format YYMMDD (040701).

    Does anybody know how to format the output of the date command?

    Thanks.


Comments

  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    try

    HELP SET

    if I recall correctly you can do something like this..


    > echo %DATE:~6,4%%DATE:~3,2%%DATE:~0,2%
    20040701


  • Closed Accounts Posts: 2,585 ✭✭✭HelterSkelter


    Thanks a million Hobbes, that worked nicely.


Advertisement