Windows Date Format

Windows Date Format

Postby Jeff Barnes » Sat Feb 23, 2013 2:13 am

Hi,

I've asked this before but never was able to get a solution...

How can I set the date format in my app to match the short date format set in Windows Regional Settings?
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Windows Date Format

Postby Jeff Barnes » Sat Feb 23, 2013 2:33 am

I figured out a way to do it :)

For anyone else looking for a solution ... Here is what I came up with:

Code: Select all  Expand view

#define HKEY_CURRENT_USER 2147483649

SET DATE FORMAT TO GetSysDate()
 


Code: Select all  Expand view

Function GetSysDate()
    LOCAL oReg, c := "Control Panel\International"
    oReg := TReg32():New( HKEY_CURRENT_USER ,c , .F.)
    cSysDate := oReg:Get("sShortDate", "" )
    oReg:Close()
Return cSysDate
 
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 113 guests