Which date format is used by Windows ???? 
Author Message
 Which date format is used by Windows ????

I'd like to detect  which date format was defined by the user in his
Windows/Control Panel/Regional Settings. How ? There must be Windows95 API
call or so.

Al info or work around is appreciated.

Kind regards,
Ab Smienk




Sat, 23 Oct 1999 03:00:00 GMT  
 Which date format is used by Windows ????

I also need to be able to read the current 'Short Date' regional date
setting, and I don't have the option of using the previous replies
solution. I saw the EnumDateFormats() API call but don't know if VB can run
it since it contains a callback pointer. Does anyone know...?
--
Steve Anderson



Sun, 24 Oct 1999 03:00:00 GMT  
 Which date format is used by Windows ????

I just found a solution at
http://www.geocities.com/CapeCanaveral/6740/index.html, but am not sure if
it will work under NT or not...
--
Steve Anderson



Sun, 24 Oct 1999 03:00:00 GMT  
 Which date format is used by Windows ????



Quote:
> I also need to be able to read the current 'Short Date' regional date
> setting, and I don't have the option of using the previous replies
> solution. I saw the EnumDateFormats() API call but don't know if VB can
run
> it since it contains a callback pointer. Does anyone know...?
> --
> Steve Anderson


Could you fake it by doing something like:
        Dim strShort As String
        strShort=Format$(CVDate("1/2/3"),"Short Date")
and then pull strShort apart to see where the various pieces ended up?
--
Please reply through the newsgroup.  The reply e-mail
address is garbage to reduce the spam rate.


Mon, 25 Oct 1999 03:00:00 GMT  
 Which date format is used by Windows ????

Hello,

        You can use GetLocaleInfo to get locale information:

   Declare Function GetLocaleInfo Lib "kernel32" Alias "GetLocaleInfoA"
(ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String,
ByVal cchData As Long) As Long

Date separator:

   Dim cResultado As String
   Dim lLCID As Long
   Dim cCad As String

  cCad = String$(255, 0)
  Call GetLocaleInfo(lLCID, LOCALE_SDATE, cCad, Len(cCad))
  cResultado = Left$(cCad, InStr(cCad, Chr$(0)) - 1)

Order: (ORDER_MONTH_DAY_YEAR = 0,  ORDER_DAY_MONTH_YEAR = 1,
ORDER_YEAR_MONTH_DAY= 2)

   Dim iResultado As Integer
   Dim lLCID As Long
   Dim cCad As String

      cCad = String$(255, 0)
      Call GetLocaleInfo(lLCID, LOCALE_IDATE, cCad, Len(cCad))
      iResultado = Val(Left$(cCad, InStr(cCad, Chr$(0)) - 1))

Hope this helps

--
Carlos J. Quintero Vivar
CAT/CANAL+
Madrid (Spain)



Quote:

> I'd like to detect  which date format was defined by the user in his
> Windows/Control Panel/Regional Settings. How ? There must be Windows95
API
> call or so.

> Al info or work around is appreciated.

> Kind regards,
> Ab Smienk





Tue, 26 Oct 1999 03:00:00 GMT  
 Which date format is used by Windows ????

Callbacks are supported by Visual Basic 5.0 Professional with the AddressOf
keyword.

--
James Johnston



Quote:
> I also need to be able to read the current 'Short Date' regional date
> setting, and I don't have the option of using the previous replies
> solution. I saw the EnumDateFormats() API call but don't know if VB can
run
> it since it contains a callback pointer. Does anyone know...?
> --
> Steve Anderson




Tue, 02 Nov 1999 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Output format of date (using ActiveX Windows date time picker)

2. Format date/time in DTPicker to display AM/PM or 24 hour time

3. Isolate date format of Form from Windows setting ?

4. VB and Windows date formats

5. change the time&date format in windows

6. Date Format?Windows Problem

7. now() date format problem between NT and Windows 2000

8. "Windows Internal Date Format"

9. Internal date format ME vs. other Windows versions

10. I am trying to update a record, i am not using data control

11. I am trying to update a record, i am not using data control

12. Format Date field in query using VBA

 

 
Powered by phpBB® Forum Software