Hi
SetDate() function don't work correct, i try:
SetDate(02,01,2006) and returns 01/01/2006
Why?
Thanks.
Fwh2.6
function Main()
local dToday := Date()
SET DATE FRENCH
SetDate( 02, 01, 2006 )
MsgInfo( Date() )
SetDate( Day( dToday ), Month( dToday ), Year( dToday ) )
MsgInfo( Date() )
return nil
Antonio Linares wrote:Wanderson,
This sample works ok. Could you please try it ? Thanks.
- Code: Select all Expand view
function Main()
local dToday := Date()
SET DATE FRENCH
SetDate( 02, 01, 2006 )
MsgInfo( Date() )
SetDate( Day( dToday ), Month( dToday ), Year( dToday ) )
MsgInfo( Date() )
return nil
CLIPPER SETDATE( PARAMS ) // nDay, nMonth, nYear
{
WORD wYear = _parni( 3 );
WORD wMonth = _parni( 2 );
WORD wDay = _parni( 1 );
#ifndef __FLAT__
_CX = wYear;
_DH = wMonth;
_DL = wDay;
_AH = 0x2B;
_AL = 0;
Dos3Call(); // asm int 0x21;
_retl( _AL == 0 );
#else
SYSTEMTIME st;
GetSystemTime( &st );
st.wYear = wYear;
st.wMonth = wMonth;
st.wDay = wDay;
_retl( SetSystemTime( &st ) );
#endif
}
Antonio Linares wrote:Wanderson,
You should have this code in source\function\datetime.c:
- Code: Select all Expand view
CLIPPER SETDATE( PARAMS ) // nDay, nMonth, nYear
{
WORD wYear = _parni( 3 );
WORD wMonth = _parni( 2 );
WORD wDay = _parni( 1 );
#ifndef __FLAT__
_CX = wYear;
_DH = wMonth;
_DL = wDay;
_AH = 0x2B;
_AL = 0;
Dos3Call(); // asm int 0x21;
_retl( _AL == 0 );
#else
SYSTEMTIME st;
GetSystemTime( &st );
st.wYear = wYear;
st.wMonth = wMonth;
st.wDay = wDay;
_retl( SetSystemTime( &st ) );
#endif
}
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 62 guests