Hi, I have this number that I would like to convert into datetime.. I am not sure about which function to use and how.. any suggestion ?
% input
2.022051711034598e+16
% desired output
'2022-05-17 11:03:45.980'

댓글 수: 1

this obviously does not work..
datetime(2.022051711034598e+16,'format','dd-mmm-yyyy HH:MM:SS')

댓글을 달려면 로그인하십시오.

 채택된 답변

Stephen23
Stephen23 2022년 10월 18일

1 개 추천

N = 2.022051711034598e+16;
S = string(uint64(N))
S = "20220517110345980"
D = datetime(S, 'inputFormat','uuuuMMddHHmmssSSS', 'Format','yyyy-MM-dd HH:mm:ss.SSS')
D = datetime
2022-05-17 11:03:45.980

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Dates and Time에 대해 자세히 알아보기

질문:

Sim
2022년 10월 18일

댓글:

Sim
2022년 10월 18일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by