uCharToVal( "Monday, 04 March 2019", "D" )
works well with English only.
From FWH1904 onwards, it will work with other codepage languages.
I tried today and it not run ( I tested with FiveWin for Harbour ver. Jannuary 2020)
My test
- Code: Select all Expand view RUN
- #include "fivewin.ch"
request hb_lang_it
request hb_codepage_itwin
Function test()
Local dtoday
Local cText_date
HB_LANGSELECT( "IT" )
HB_SETCODEPAGE( "ITWIN" )
dtoday:=date()
cText_date:=date2txt(dToday)
MsgInfo(cText_date)
Msginfo( uCharToVal( cText_date, "D" ) )
return nil
//----------------------------------------------------------------------------------//
Function Date2Txt(dTemp)
LOCAL f, m, cMese, dFech,dDay,d
Local i,c
local aMesi[ 12 ]
local aWeek[ 7 ]
AEval( aMesi, { |c,i| aMesi[ i ] := NToCMonth( i ) } )
AEval( aWeek, { |c,i| aWeek[ i ] := NToCDOW( i ) } )
f:=DTOS (dTemp)
m:=MONTH(dTemp)
d:=dow(dtemp)
cMese:=LEFT(IF(m<>0, aMesi[m] ,"" ),3)
dday :=LEFT(IF(d<>0, oemtoansi(aWeek[d]) ,""),3)
dFech:=IF(m<>0,dday+", "+ SubStr(f,7,2)+' '+cMese+' '+SubStr(f,1,4),'')
RETURN (dFech)
Any solution ?