Hello,
Is there a function for that?
Thank you
Function getUnix2(dDate,tTime)
Local nYearI := hb_ctot("1970/01/01 00:00:00.000","YYYYMMDDHHMMSSFFF")
Local cDateT := DTOC(dDate)+ " " +tTime
Local nYear := hb_ctot(cDateT)
Local nSeconds:= (nYear-nYearI) * 86400
return nSeconds
Function getUnix()
Local nYearI := hb_ctot("1970/01/01 00:00:00.000","YYYYMMDDHHMMSSFFF")
Local nYear := HB_dateTime()
Local nSeconds:= 0
nSeconds := (nYear-nYearI) * 86400
return nSeconds
Function getDateTime(nSeconds)
Local nYearI := hb_ctot("1970/01/01 00:00:00.000","YYYYMMDDHHMMSSFFF")
Local nSec := HB_dateTime()
IF VALTYPE(nSeconds)!='N'
? "Function getDateAndTime requiere como parametro una variable Numerica"
Return 0
ENDIF
nSec := nYearI + (nSeconds / 86400)
Return nSec
Function getDate(nSeconds)
Local nYearI := hb_ctot("1970/01/01 00:00:00.000","YYYYMMDDHHMMSSFFF")
Local nSec := HB_dateTime()
IF VALTYPE(nSeconds)!='N'
? "Function getDateAndTime requiere como parametro una variable Numerica"
Return 0
ENDIF
nSec := nYearI + (nSeconds / 86400)
dTemp := hb_DateTime()
dTemp := getDateTime(IIF(VALTYPE(nSeconds)=='C',VAL(nSeconds),nSeconds))
dTemp := HB_TTOC(dTemp)
cTime := SUBSTR(dTemp,12,8)
Return SUBSTR(dTemp,1,10)
Function getTime(nSeconds)
Local nYearI := hb_ctot("1970/01/01 00:00:00.000","YYYYMMDDHHMMSSFFF")
Local nSec := HB_dateTime()
IF VALTYPE(nSeconds)!='N'
? "Function getDateAndTime requiere como parametro una variable Numerica"
Return 0
ENDIF
nSec := nYearI + (nSeconds / 86400)
dTemp := hb_DateTime()
dTemp := getDateTime(IIF(VALTYPE(nSeconds)=='C',VAL(nSeconds),nSeconds))
dTemp := HB_TTOC(dTemp)
cTime := SUBSTR(dTemp,12,8)
Return SUBSTR(dTemp,12,8)
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 57 guests