Hi,
How can I get the "Short Date Format" from windows?
I would like to match my programs date format with what is setup in the windows regional settings.
function dtocfmt( dDate, cFormat )
local cDate
DEFAULT cFormat := Set( _SET_DATEFORMAT )
cDate := Lower( cFormat )
cDate := StrTran( cDate, 'dd', StrZero( Day( dDate ), 2 ) )
if 'mmmm' $ cDate
cDate := StrTran( cDate, 'mmmm', cMonth( dDate ) )
elseif 'mmm' $ cDate
cDate := StrTran( cDate, 'mmm', Left( cMonth( dDate ), 3 ) )
else
cDate := StrTran( cDate, 'mm', StrZero( Month( dDate ), 2 ) )
endif
if 'yyyy' $ cDate
cDate := StrTran( cDate, 'yyyy', Str( Year( dDate ), 4, 0 ) )
else
cDate := StrTran( cDate, 'yy', StrZero( Year( dDate ) % 100, 2 ) )
endif
return cDate
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 82 guests