How do I convert UTC time to Unix time?
조회 수: 7 (최근 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
추가 답변 (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!