Hi Guys,
Do you know if is there in Harbour/Fivewin any function like GetTime() from Java ?
Or
How could I convert a Date to a double value?
// https://pt.stackoverflow.com/questions/ ... no-harbour
#Include "FiveWin.ch"
FUNCTION Main()
SET CENTURY ON
SET DATE BRITISH
SET TIME FORMAT TO "HH:MM:SS"
SET EPOCH TO YEAR( DATE() ) - 30
SET SOFTSEEK OFF
SET WRAP ON
SETCANCEL( .F. )
SET CONFIRM OFF
SET DELETED ON
SET _3DLOOK ON
SET UNIQUE OFF
SET ESCAPE OFF
SET EXACT ON // CONTROLA O :=, = e ==
SET EXCLUSIVE OFF
SET MULTIPLE OFF
SET OPTIMIZE ON
? hb_Dtoc( Date(), "YYYY-MM-DD" )
? hb_Dtoc( Date(), "DD-MM-YYYY" )
? hb_Dtoc( Date(), "MMDDYY" )
? hb_Dtoc( Date(), "DDMMYY" )
RETURN NIL
FUNCTION hb_Dtoc( dData, dFormat )
IF dFormat == NIL
RETURN Dtoc( dData )
ENDIF
dFormat := Upper( dFormat )
dFormat := StrTran( dFormat, "DD", StrZero( Day( dData ), 2 ) )
dFormat := StrTran( dFormat, "MM", StrZero( Month( dData ), 2 ) )
dFormat := StrTran( dFormat, "YYYY", StrZero( Year( dData ), 4 ) )
dFormat := StrTran( dFormat, "YY", StrZero( Mod( Year( dData ), 100 ), 2 ) )
RETURN( dFormat )
// FIN / END
How could I convert a Date to a double value?
? HB_DateTime() // --> 2024-12-09 19:29:45
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 15 guests