Board index » cppbuilder » About date format in DOS under XP

About date format in DOS under XP


2006-03-25 12:04:39 AM
cppbuilder37
Hi
Sorry if this is not the newsgroup where I should to ask my question. But I
don't know the *right* newsgroup.
In Windows XP in Control Panel ->Date, Time, Language, and Regional
Options ->Change the format of numbers, dates, and times you can customize
date format by changing "Short date format", for example, from dd.MM.yyyy to
dd.MM.yy and vice verse. Consequently when you will issue DOS command DIR
file date will be displayed accordingly i.e. as dd.MM.yyyy or dd.MM.yy.
My question is what is a (new) DOS int 21h service that can allow me to
determine what date format currently is used? Well-known DOS service 38h and
6501h don't report this information. They tell only about American,
European, and Japan date representation.
Vladimir Grigoriev
 
 

Re:About date format in DOS under XP

"Vladimir Grigoriev" < XXXX@XXXXX.COM >wrote in message
Quote
Sorry if this is not the newsgroup where I should to ask my question.
But I don't know the *right* newsgroup.
This has already been answered in the .nativeapi group.
Gambit
 

Re:About date format in DOS under XP

Remy Lebeau (TeamB) wrote:
Quote
>Sorry if this is not the newsgroup where I should to ask my
>question. But I don't know the right newsgroup.

This has already been answered in the .nativeapi group.
I'm not sure if it has. I think he was asking if there is an MSDOS
function that can obtain locale information from the Win32 system that
is hosting the VDM. Of course Builder can't generate MSDOS applications
anyway but it's not entirely clear where such a question could be asked.
That was my interpretation anyway.
--
Andrue Cope [TeamB]
[Bicester, Uk]
info.borland.com/newsgroups/guide.html
 

{smallsort}

Re:About date format in DOS under XP

Hi Remy
I will ask my question everywhere while I will not get answer on my
question. If you know the right group or a man who knows the answer (not
assumptions) I will be obliged.
A question is simple. Is any DOS service that will allow a DOS program
running on XP to get date format currently in use? I think that such service
must be (it is my *assumption*) but I don't know it yet.
Vladimir Grigoriev
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote

"Vladimir Grigoriev" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...

>Sorry if this is not the newsgroup where I should to ask my question.
>But I don't know the *right* newsgroup.

This has already been answered in the .nativeapi group.


Gambit


 

Re:About date format in DOS under XP

It is interesting to note the following fact (bug?).
Among other proposals I got as answers on my question one was to use /4
parameter with DOS command DIR.
If your type DIR /? on XP you will see the following help message
/4 Displays four-digit years
But if you will change the date format settings through Control Panel from
four digits to two digits for year and then will isuue DIR /4 you will not
see four digits years!
Vladimir Grigoriev
"Vladimir Grigoriev" < XXXX@XXXXX.COM >wrote in message
Quote
Hi Remy
I will ask my question everywhere while I will not get answer on my
question. If you know the right group or a man who knows the answer (not
assumptions) I will be obliged.
A question is simple. Is any DOS service that will allow a DOS program
running on XP to get date format currently in use? I think that such
service
must be (it is my *assumption*) but I don't know it yet.
Vladimir Grigoriev

"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message
news:44244f86$ XXXX@XXXXX.COM ...
>
>"Vladimir Grigoriev" < XXXX@XXXXX.COM >wrote in message
>news: XXXX@XXXXX.COM ...
>
>>Sorry if this is not the newsgroup where I should to ask my question.
>>But I don't know the *right* newsgroup.
>
>This has already been answered in the .nativeapi group.
>
>
>Gambit
>
>


 

Re:About date format in DOS under XP

Vladimir Grigoriev wrote:
Quote
Among other proposals I got as answers on my question one was to use
/4 parameter with DOS command DIR.
If your type DIR /? on XP you will see the following help message
Okay so perhaps you found a bug in CMD.EXE but I'm confused why you
think that is relevant. In the above scenario you are not executing any
MSDOS commands nor using its API.
DOS applications run inside things called VDMs (Virtual DOS Machines).
These are basically emulators. What you are asking for is way for an
application running inside an emulator to communicate with the emulator
and obtain information about the operating system the emulator is
running on.
I'll reiterate what I posted previously:When you open a command prompt
under XP you are not using an MSDOS session. It is a Windows console
and just as much a Win32 environment as your desktop is. It's just a
text based environment rather than graphical.
So let's try and make sure we understand each other:What development
environment (ie;what compiler/IDE) are you using to develop this "DOS
application"?
--
Andrue Cope [TeamB]
[Bicester, Uk]
info.borland.com/newsgroups/guide.html
 

Re:About date format in DOS under XP

Yes. I have only pointed out that while I am searching the answer I
encounter other interesting things as this Microsoft bug in DIR command on
XP.
Vladimir Grigoriev
"Andrue Cope [TeamB]" < XXXX@XXXXX.COM >wrote in message
Quote
Vladimir Grigoriev wrote:

>Among other proposals I got as answers on my question one was to use
>/4 parameter with DOS command DIR.
>If your type DIR /? on XP you will see the following help message

Okay so perhaps you found a bug in CMD.EXE but I'm confused why you
think that is relevant. In the above scenario you are not executing any
MSDOS commands nor using its API.

DOS applications run inside things called VDMs (Virtual DOS Machines).
These are basically emulators. What you are asking for is way for an
application running inside an emulator to communicate with the emulator
and obtain information about the operating system the emulator is
running on.

I'll reiterate what I posted previously:When you open a command prompt
under XP you are not using an MSDOS session. It is a Windows console
and just as much a Win32 environment as your desktop is. It's just a
text based environment rather than graphical.

So let's try and make sure we understand each other:What development
environment (ie;what compiler/IDE) are you using to develop this "DOS
application"?
--
Andrue Cope [TeamB]
[Bicester, Uk]
info.borland.com/newsgroups/guide.html
 

Re:About date format in DOS under XP

Vladimir Grigoriev wrote:
Quote
Yes. I have only pointed out that while I am searching the answer I
Yes, and you still haven't answered any relevant questions that might
help us help you.
You haven't clarified exactly what OS your application is targeting.
If you want to write a pure DOS application, then I think the answer
is No, you can't get it (because DOS doesn't have that feature?).
BTW, if the answer should turn out to be Yes, then it should be listed
here:
www.ctyme.com/rbrown.htm
OTOH, if you are writting a Win32 Console application, then simply
call
GetDateFormat(LOCALE_USER_DEFAULT,DATE_SHORTDATE,NULL,NULL,Result,sizeof(Result));
 

Re:About date format in DOS under XP

Hi Bob
I am writing a pure DOS application (I have designed FileSeek class for
using with standard 8.3 DOS file names and with long file names. It is not
important that programming language I use.) which of course may be run under
XP. The application is simply a demo of my FileSeek class. It prints out a
listing similar that DIR command does. For standard 8.3 DOS output there is
not any problem. I use DOS service 38h to get date format i.e. American,
European, or Japan and display an output similar that DIR commad does under
DOS i.e with two digit years. But listing the DIR command produces under XP
is different then one that is under DOS. And I want to simulate the similar
listing under XP Command Prompt Box in my demo. So I need to get short date
format that is used in XP.
Vladimir Grigoriev
"Bob Gonder" < XXXX@XXXXX.COM >wrote in message
Quote
Vladimir Grigoriev wrote:

>Yes. I have only pointed out that while I am searching the answer I

Yes, and you still haven't answered any relevant questions that might
help us help you.

You haven't clarified exactly what OS your application is targeting.

If you want to write a pure DOS application, then I think the answer
is No, you can't get it (because DOS doesn't have that feature?).
BTW, if the answer should turn out to be Yes, then it should be listed
here:
www.ctyme.com/rbrown.htm

OTOH, if you are writting a Win32 Console application, then simply
call


GetDateFormat(LOCALE_USER_DEFAULT,DATE_SHORTDATE,NULL,NULL,Result,sizeof(Res
ult));
Quote



 

Re:About date format in DOS under XP

As I think if there is not such service in DOS when it is incorrectly for
Microsoft to use short date format given from XP local settings in output
from DIR command! Microsoft should use only those features in Command Prompt
Box for *DOS* commands such as DIR and others that are available for any DOS
programmer. And what is available for DOS programmer? DOS services and
nothing more!
Vladimir Grigoriev
 

Re:About date format in DOS under XP

Vladimir Grigoriev wrote:
Quote
I am writing a pure DOS application
Ok then, as I mentioned, if it isn't listed in Ralph Brown's list, it
probably doesn't exist.
Though none of us are clear as to why you would want to write a pure
DOS program to run on XP machines?
Realize that your expectations as voiced in the TASM group, could be
extended to needing an interrupt for (nearly) EVERY Win32 API !
P.S.
Converting to Win Api from interrupts, and 32bit addresses from
seg:offset, isn't that big a deal. And the liberation of not having to
manage ds and es, and the large memory space available...well, it's
quite wonderfull to the asm programmer.
 

Re:About date format in DOS under XP

Bob, as I have mentioned if Microsoft uses such features as short date
format from XP local settings in it so-called DOS DIR command then these
features should be available for other programmers. It is principally
incorrectly to write utilities for using in an operatonal system using
another API than that exists in this operational system. (So I think that
such DOS service should be)
As for my program I have designed a FileSeek class that is used in data base
system that is used till now in DOS. So I can use only 16-bit assembler. I
'd like that a user can see long file names instead of old 8.3 file names.
Vladimir Grigoriev
"Bob Gonder" < XXXX@XXXXX.COM >wrote in message
Quote
Vladimir Grigoriev wrote:

>I am writing a pure DOS application

Ok then, as I mentioned, if it isn't listed in Ralph Brown's list, it
probably doesn't exist.

Though none of us are clear as to why you would want to write a pure
DOS program to run on XP machines?

Realize that your expectations as voiced in the TASM group, could be
extended to needing an interrupt for (nearly) EVERY Win32 API !

P.S.
Converting to Win Api from interrupts, and 32bit addresses from
seg:offset, isn't that big a deal. And the liberation of not having to
manage ds and es, and the large memory space available...well, it's
quite wonderfull to the asm programmer.



 

Re:About date format in DOS under XP

Vladimir Grigoriev wrote:
Quote
As I think if there is not such service in DOS when it is incorrectly for
Microsoft to use short date format given from XP local settings in output
from DIR command! Microsoft should use only those features in Command Prompt
Box for *DOS* commands such as DIR and others that are available for any DOS
programmer. And what is available for DOS programmer? DOS services and
nothing more!
As others keep telling you...It is NOT a DOS command anymore.
It is a Win32 Console application, and those services ARE available to
all Win32 console (and GUI too) applications.
They even changed the name of the program from command.com to cmd.exe
If you want old-time DOS visualization, use the old DOS program.
C:\>command.com /c dir
 

Re:About date format in DOS under XP

Bob
I repeat once more. It is incorrectly to write an utility program for a
specific operational environment such a way that the utility is writen with
API not used in this operational environment.
DIR command (no matter is it a console application or pure DOS program) is
in essence DOS command! It is specially written for using in DOS command
prompt window. It is unnecessary for Windows. Are you agree? It is
specially written only for DOS compatibility. So you can call it a console
application, a GUI application, or what else you can imagine, but it is DOS
COMMAND and NOTHING MORE.
Vladimir Grigoriev
"Bob Gonder" < XXXX@XXXXX.COM >wrote in message
Quote
Vladimir Grigoriev wrote:

>As I think if there is not such service in DOS when it is incorrectly
for
>Microsoft to use short date format given from XP local settings in output
>from DIR command! Microsoft should use only those features in Command
Prompt
>Box for *DOS* commands such as DIR and others that are available for any
DOS
>programmer. And what is available for DOS programmer? DOS services and
>nothing more!

As others keep telling you...It is NOT a DOS command anymore.
It is a Win32 Console application, and those services ARE available to
all Win32 console (and GUI too) applications.
They even changed the name of the program from command.com to cmd.exe
If you want old-time DOS visualization, use the old DOS program.

C:\>command.com /c dir



 

Re:About date format in DOS under XP

"Vladimir Grigoriev" < XXXX@XXXXX.COM >wrote in message
Quote
I will ask my question everywhere
Please do not do that. It is against Borland's newsgroup guidelines
(info.borland.com/newsgroups). Only post questions to the single
most appropriate group. Cross/multi-posted messages may or may not be
cancelled and removed from the server.
Quote
while I will not get answer on my question.
Yes, the question was answered. I even told you exactly which specific
functions to call.
Quote
Is any DOS service that will allow a DOS program
running on XP to get date format currently in use?
I, and several others, have already answered that question several times for
you now, but you keep refusing the answers.
Gambit