필터 지우기
필터 지우기

Transforming a character double into date format

조회 수: 11 (최근 30일)
Maria Sarcos
Maria Sarcos 2021년 9월 17일
답변: s pernot 2021년 9월 17일
I have a character (double) vector taken from a txt file corresponding to a timestamp of some measurement data, an example of a character is:
197709131435
I want to transform this into a date format eg: 1977 is the year, 09 month, 13 day, 14:35 time. This is to properly separate my data and find daily and seasonal trends.
I tried changing the character into a string and using the datetime function with the input format I want but it didn't work. How can I do this?

답변 (1개)

s pernot
s pernot 2021년 9월 17일
datetime('197709131435', 'InputFormat', 'yyyyMMddHHmm')

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by