How do I convert UTC time to Unix time?
22 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
James Tursa
2023 年 9 月 19 日
You are going to need a date (y,m,d) to go with that to calculate Unix Time.
採用された回答
Dyuman Joshi
2023 年 9 月 19 日
編集済み: Dyuman Joshi
2023 年 9 月 19 日
%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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Dates and Time についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!