FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Obtaining windows region date format
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Obtaining windows region date format
Posted: Thu Dec 07, 2017 03:08 AM

Hi guys,
How to obtain a windows region date format?

TIA

FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Obtaining windows region date format
Posted: Thu Dec 07, 2017 04:16 AM
Code (fw): Select all Collapse
   #ifndef HKEY_CURRENT_USER
      #define  HKEY_CURRENT_USER    0x80000001
   #endif

function test()

   local oReg

   oReg  := TReg32():New( HKEY_CURRENT_USER, "Control Panel\International", .f. )
   ? oReg:Get( "sShortDate" )
   ? oReg:Get( "sLongDate" )
   oReg:Close()

return nil
Regards



G. N. Rao.

Hyderabad, India
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: Obtaining windows region date format
Posted: Thu Dec 07, 2017 04:19 AM

Thanks Rao!

FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Obtaining windows region date format
Posted: Thu Dec 07, 2017 05:29 AM

If you want to display date values in these formats, you can use

? cValToStr( dDateValue, cFormat )

For displaying the date values in Xbrowse using these formats, you can set oCol:cEditPicture := cFormat

Regards



G. N. Rao.

Hyderabad, India
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: Obtaining windows region date format
Posted: Thu Dec 07, 2017 06:47 AM

Thanks for the tip Rao!

FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour

Continue the discussion