• MS-DOS

    Author
    Topic
    #408277

    How do I extract the date information (using a DOS sentence) of a file in DOS??

    I need to use that command in a .bat file and compare to today

    Viewing 3 reply threads
    Author
    Replies
    • #866450

      Hello! I’ve just been pointed at your post!

      Do you really mean MS-DOS, if so, which version?

      Or do you mean the Command Prompt window of something like XP?

      The answer would depend on which version you have, since the newer versions have more power to do what you want.

      Let me know, and I’ll have a bash…

      John

    • #866451

      Hello! I’ve just been pointed at your post!

      Do you really mean MS-DOS, if so, which version?

      Or do you mean the Command Prompt window of something like XP?

      The answer would depend on which version you have, since the newer versions have more power to do what you want.

      Let me know, and I’ll have a bash…

      John

    • #866567

      It depends on what version of DOS you have. The batch code in the attached file should do what you asked for versions of DOS before the version that came with Windows NT. It may or may not work on later versions.

      • #866837

        Legare

        If the OP has Windows XP your BATch file could be optimised significantly!

        I’ll wait for a response…

        John

        PS There are also the usual problems with the format of dates, dependent on the Regional/International Settings. Many of these BATch files blithely assume that the whole universe works with mm/dd/yy format!

        • #866893

          John,

          It doesn’t all work with mm/dd/yy????? confused3 What is wrong with the majority of the known world?? disappointed anigrin

          Joe

          --Joe

          • #866901

            > What is wrong with the majority of the known world??
            It just never seemed right to put the least significant digit in the middle of a numerical value to the rest of us.

            StuartR

            • #866946

              It makes as much sense as putting the most significant digits last! dizzy bow

            • #866985

              I can see that the countries which use
              yyyy mm dd hr mn sc
              are going to have to sort you out!

              John

            • #867023

              yep

            • #867024

              yep

            • #867035

              I’ve got to admit that I’ve never understood why all countries that I know of use the ‘proper’ format for time (hr mn sc) but not for dates.

              By the way, I prefer to avoid the numeric representation of months when dealing with people. I haven’t encountered a lot of confusion over which month is meant, but whenever I have encountered it it’s always been due to the use of numbers. I have yet to encounter someone (English-speaking) who doesn’t understand what month I mean, without even thinking about it, when I say ‘September’.

            • #867051

              We’re in deep water even with time, because there is the 24-hour “military” time vs. the 12 hour AM/PM version, plus innumerable variations of whether hours are always two digits, or don’t have leading zeros, and so forth.

              I spent a couple of happy days documenting all the forms of date and time for the 90-odd regional settings in NT4, W2K and WXP — and if you’re not careful I’ll tell you all the details!!

              John

            • #867087

              hailpraise For having the fortitude to do that in the first place. But please don’t joke (you were joking right?? RollEyes) about subjecting another living being to that level of excitement yikes surrender

              Joe

              --Joe

            • #867088

              hailpraise For having the fortitude to do that in the first place. But please don’t joke (you were joking right?? RollEyes) about subjecting another living being to that level of excitement yikes surrender

              Joe

              --Joe

            • #867052

              We’re in deep water even with time, because there is the 24-hour “military” time vs. the 12 hour AM/PM version, plus innumerable variations of whether hours are always two digits, or don’t have leading zeros, and so forth.

              I spent a couple of happy days documenting all the forms of date and time for the 90-odd regional settings in NT4, W2K and WXP — and if you’re not careful I’ll tell you all the details!!

              John

            • #867036

              I’ve got to admit that I’ve never understood why all countries that I know of use the ‘proper’ format for time (hr mn sc) but not for dates.

              By the way, I prefer to avoid the numeric representation of months when dealing with people. I haven’t encountered a lot of confusion over which month is meant, but whenever I have encountered it it’s always been due to the use of numbers. I have yet to encounter someone (English-speaking) who doesn’t understand what month I mean, without even thinking about it, when I say ‘September’.

            • #866986

              I can see that the countries which use
              yyyy mm dd hr mn sc
              are going to have to sort you out!

              John

            • #866947

              It makes as much sense as putting the most significant digits last! dizzy bow

          • #866902

            > What is wrong with the majority of the known world??
            It just never seemed right to put the least significant digit in the middle of a numerical value to the rest of us.

            StuartR

        • #866894

          John,

          It doesn’t all work with mm/dd/yy????? confused3 What is wrong with the majority of the known world?? disappointed anigrin

          Joe

          --Joe

        • #869460

          JOHN,

          thanks a lot!! YOUR answer actually worked wonderfully

          (((sorry everybody else got worthlessly in the day/time format discussion … argue )))

        • #869461

          JOHN,

          thanks a lot!! YOUR answer actually worked wonderfully

          (((sorry everybody else got worthlessly in the day/time format discussion … argue )))

      • #866838

        Legare

        If the OP has Windows XP your BATch file could be optimised significantly!

        I’ll wait for a response…

        John

        PS There are also the usual problems with the format of dates, dependent on the Regional/International Settings. Many of these BATch files blithely assume that the whole universe works with mm/dd/yy format!

    • #866568

      It depends on what version of DOS you have. The batch code in the attached file should do what you asked for versions of DOS before the version that came with Windows NT. It may or may not work on later versions.

    Viewing 3 reply threads
    Reply To: MS-DOS

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: