How do I convert UTC time to Unix time?
16 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Jen B
am 19 Sep. 2023
Kommentiert: Dyuman Joshi
am 21 Sep. 2023
I have a datafile with time in UTC, for example: 192503.000 where the format is hhmmss.ss format, where hh is hours (00–23), mm is minutes, and ss.ss is seconds and fractions of seconds.. How do I convert this to Unix time?
1 Kommentar
James Tursa
am 19 Sep. 2023
You are going to need a date (y,m,d) to go with that to calculate Unix Time.
Akzeptierte Antwort
Dyuman Joshi
am 19 Sep. 2023
Bearbeitet: Dyuman Joshi
am 19 Sep. 2023
%Example
y = datetime('now','TimeZone','UTC')
%Get time in UNIX format
z=posixtime(y)
%Change the display format
format longg
z
If you have data in any other format then datetime(), convert it to datetime() and the use posixtime
4 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Dates and Time finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!