Re: Source changes

new topic     » goto parent     » topic index » view thread      » older message » newer message

Derek Parnell wrote:
> 
> CChris wrote:
> > 
> > Derek Parnell wrote:
> > > The commonly used date format is {YYYY,MM,DD, ...} but the Epoch form is
> > > also
> > > used. There are at least two good date-time libraries in the User
> > > Contributions
> > > section so I'd suggest that we combine the good aspects of those into a
> > > single
> > > officially-supported library.
> 
> > What you say is true for UK/US aligned countries. Most Latin countries
> > (France,
> > Spain, Italy...) use DD-MM-YY or -YYYY format. And if I remember correctly,
> > Japan uses another specific format. 
> 
> I suspect you have misread what I said above. The date format I described is
> the INTERNAL one and not the one formatted for display. I know the locale
> issues
> very well as I have to deal with the US-Centric world far too often.
> 
> Most countries use DD-MM-YYYY, Japan mostly uses YYYY-MM-DD, and the U.S. uses
> MM-DD-YYYY, plus there are other variations. 
> 
> > As a result, locale-dependent routines are needed. Problem is, how will they
> > behave under DOS, where I am not sure that locales make sense at all?
> 
> I had in mind that the applications using my library would specify the locale
> elements (once) at run time and I wouldn't try to get them from the operating
> system. I'd leave that task to the application.
> 
> -- 
> Derek Parnell
> Melbourne, Australia
> Skype name: derek.j.parnell

That was not clear to me; now it is.

You can ask readily Windows about the user locale, and you can ask DOS for the
current country specific info thru int #21, AX=#3800, DS:DX->34 byte buffer.
The date format will be at offset 0 on return: 0 = USA	mm dd yy,1 = Europe dd mm
yy
 2 = Japan	yy mm dd).
The buffer format is as follows, quoted from RBIL v61:
 00h	WORD	date format (see #01398)
 02h  5 BYTEs	ASCIZ currency symbol string
 07h  2 BYTEs	ASCIZ thousands separator
 09h  2 BYTEs	ASCIZ decimal separator
 0Bh  2 BYTEs	ASCIZ date separator
 0Dh  2 BYTEs	ASCIZ time separator
 0Fh	BYTE	currency format
		bit 2 = set if currency symbol replaces decimal point
		bit 1 = number of spaces between value and currency symbol
		bit 0 = 0 if currency symbol precedes value
			1 if currency symbol follows value
 10h	BYTE	number of digits after decimal in currency
 11h	BYTE	time format
		bit 0 = 0 if 12-hour clock
			1 if 24-hour clock
 12h	DWORD	address of case map routine
		(FAR CALL, AL = character to map to upper case [>= 80h])
 16h  2 BYTEs	ASCIZ data-list separator
 18h 10 BYTEs	reserved

For Linux, I don't know.

CChris

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu