UNIX to date
Posted: Thu May 11, 2023 10:30 am
I must converte a number -> time_next_update_unix
I found this function but not run ok
chat Open Ai give me this but not run
ho I can resolve ?
I found this function but not run ok
- Code: Select all Expand view
FUNCTION UnixToDate(nUnix)
LOCAL nSecs, dDate, cTime, dDateTime
nSecs := nUnix - 28800 // correzione fuso orario
dDate := CTOD("01/01/1970")
cTime := stot(nSecs / 1000)
dDateTime := dDate + cTime
RETURN dDateTime
chat Open Ai give me this but not run
- Code: Select all Expand view
- FUNCTION UnixToDate(nUnix)
LOCAL nSecs, dDate, cTime, dDateTime
// Converti i secondi Unix in una data Clipper e un valore di tempo
nSecs := nUnix - 28800 // correzione fuso orario
dDate := CTOD("01/01/1970")
cTime := CTOT(TIME(SECONDS(nSecs) * 1000))
// Combina la data e l'ora Clipper in un valore di data e ora Clipper
dDateTime := dDate + cTime
// Restituisci la data e ora convertite
RETURN dDateTime
ho I can resolve ?