Come utilizzare JSL per convertire i secondi dal 1° gennaio 1970 in HH:MM:SS giorni, mesi e anni?Ciao!
1652335737
A
2022/05/12 14:08:57
Grazie!
ScriptingRi: Come utilizzare JSL per convertire i secondi dal 1 gennaio 1970 in HH:MM:SS giorni, mesi e anni?La formula per effettuare la modifica è:
1652335737 + Informat( "01/01/1970", "mm/dd/yyyy" ) + In Hours( 8 )
L'aggiunta delle 8 ore nel calcolo, è che apparentemente l'ora di inizio per il 01/01/1970 è 08:00:00
Questo JSL visualizza il nuovo valore calcolato dalla formula
Show( Format( 1652335737 + Informat( "01/01/1970", "mm/dd/yyyy" ) + In Hours( 8 ), "yyyy-mm-ddThh:mm:ss" ) );
Format(1652335737 + Informat("01/01/1970", "mm/dd/yyyy") + In Hours(8), "yyyy-mm-ddThh:mm:ss") = "2022-05-12T14:08:57";Ri: Come utilizzare JSL per convertire i secondi dal 1 gennaio 1970 in HH:MM:SS giorni, mesi e anni?OK

Ri: Come utilizzare JSL per convertire i secondi dal 1 gennaio 1970 in HH:MM:SS giorni, mesi e anni?
Ri: Come utilizzare JSL per convertire i secondi dal 1 gennaio 1970 in HH:MM:SS giorni, mesi e anni?Come invertire questo calcolo?
Ad esempio, calcola la data 20230214 in secondi
Grazie!
In Days( Informat( Char( 20230214 ) ) -In Hours( 8 ) ) - In Days( 1jan1970 )
??
1676304000000
Ri: Come utilizzare JSL per convertire i secondi dal 1 gennaio 1970 in HH:MM:SS giorni, mesi e anni?Names Default To Here( 1 );
date = "20230214";
// The JMP time values are based upon the number of seconds
// since January 1, 1904, therefore the calculation to the
// number of seconds since then would be
JMPDate = Date MDY( num(substr(date,5,2)), num(substr(date,7,2)), num(substr(date, 1, 4)));
show(JMPDate, format(JMPDate,"m/d/y"));
// To convert this to the number of seconds since January 1, 1970
Jan1970Date = JMPDate - informat("01/01/1970", "m/d/y");
show(Jan1970Date);