how to convert date to milliseconds (Binance format)
Mostra commenti meno recenti
I got this function some time ago to convert datetime from Binance format into Matlab format, but now I need to do viceversa too, so to convert a certain datetime into Binance milliseconds format.
function [out_date] = date_from_binance_to_dt(raw_date)
out_date = string(datestr(datevec(raw_date/60/60/24/1000) + [1970 0 0 0 0 0]));
end
Can someone please help me to create the inverse function of mine one?
Thank you!
3 Commenti
Steven Lord
il 30 Nov 2021
Can you point to a definition of the specific "Binance format" that you want to convert to and from? I'm guessing you probably don't actually need to convert from a "raw date" (a serial date number? a datetime value?) to a date vector and then a date string, there's probably a way to perform the conversion more directly.
endystrike
il 30 Nov 2021
endystrike
il 30 Nov 2021
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su MATLAB in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!