• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 151
  • Last Modified:

how to check which regional configuration has been use on the computer

how to check which regional configuration has been use on the computer.

Ok experts, he we go again.

I need to know what kind of datatime is been use on the regional config, i mean i want to know this:

If is like this :MM/dd/yyyy hh:nn:ss AM/PM

or this: dd/MM/yyyy hh:nn:ss AM/PM

by the way i don't want to use the registry.

and then create a function that will be like this:

i will have a format datatime save on a string on my prog. Then instead I use strtodatetime i'm going to use this function. This function will see if this string is equal to the right regional config, if not then will change the format datatime to the right datatime.


function convertstrtodatatime(datet : string) : TDateTime
begin
     // it will check if the regional config is still the same
     // then if not will change this datet to the right format
    // then return tdatetime back
end;
0
rafaelrgl
Asked:
rafaelrgl
  • 3
  • 2
1 Solution
 
MerijnBSr. Software EngineerCommented:
check the variable LongDateFormat
0
 
rafaelrglAuthor Commented:
something is not right, when i use this command:

datetimetostr(now()) is like this : 7/23/2007 3:19:08 PM

ShortDateFormat + ' ' + ShortTimeFormat  : M/d/yyyy h:mm AMPM

so this here: 7/23/2007 3:19:08 PM is like this M/d/yyyy h:mm:ss AMPM


they are not the same: M/d/yyyy h:mm AMPM <> M/d/yyyy h:mm:ss AMPM


what's wrong here?
0
 
rafaelrglAuthor Commented:
LongDateFormat + LongTimeFormat : dddd, MMMM dd, yyyy h:mm:ss AMPM

and

datetimetostr(now()) is like this : 7/23/2007 3:19:08 PM


that's does not make sense to me.

those are not equal.

dddd, MMMM dd, yyyy h:mm:ss AMPM <> 7/23/2007 3:19:08 PM : not the same format????
0
 
MerijnBSr. Software EngineerCommented:
DateTimeToStr() uses ShortDateFormat + ' ' + LongTimeFormat
0
 
rafaelrglAuthor Commented:
take a look on my other question?
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now