DateTime conversion from Table Column

조회 수: 9 (최근 30일)
Djamil Boulahbal
Djamil Boulahbal 2020년 9월 17일
댓글: Star Strider 2020년 9월 17일
I have a table (from ASCII file) that has various information in it. The first column is a 'DateTime' and has units of 'ticks'. It is supposed to be a Long Integer, but when loaded in the table, it shows up in scientific notation (double). How do I force that to be an integer, at load time?
Then, the next question is how to convert a DateTime entry into something useful. There is the ConvertTo function in the financial toolbox, but I have no access to it.
  댓글 수: 1
Asad (Mehrzad) Khoddam
Asad (Mehrzad) Khoddam 2020년 9월 17일
Is it Unix time stamp? or simply ticks

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

채택된 답변

Star Strider
Star Strider 2020년 9월 17일
The datetime function has a 'ConvertFrom' option. For one example, see: Convert Excel Date Number to Datetime There are other options such as 'posixtime'.
  댓글 수: 1
Star Strider
Star Strider 2020년 9월 17일
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.

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

추가 답변 (2개)

Djamil Boulahbal
Djamil Boulahbal 2020년 9월 17일
@mehrzad - those are ticks, on a WIndows 10 64-Bit laptop
@starstrider - those functions are only available in the financial toolbox, which I do not have. I'm looking for alternatives.
  댓글 수: 1
Star Strider
Star Strider 2020년 9월 17일
Those functions are available in core MATLAB.
Click on the link I posted. It will take you to the appropriate section of the datetime. documentation.

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


Djamil Boulahbal
Djamil Boulahbal 2020년 9월 17일
Thank you very much. I was somehow looking for the convertTo function, and my Matlab version/toolboxes do not have it. Thanks again.

카테고리

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