I get error message when converting epoch date to number

>> todatenum(unix_time)
Undefined function 'todatenum' for input arguments of type 'double'.
Sinze I am a recently new user, could anyone help me in solving this issue.

댓글 수: 3

Robert - according to todatenum, the input to this function is a CDF epoch object. Presumably, given the error message, your unix_time is a double or an integer in seconds since 1970. Is this correct?
Geoff, thanks, yes that could be true. Do you know how to convert my double (epoch) to the Matlab date?
R2014b or later, use datetime objects with 'ConvertFrom', 'posixtime'. Otherwise grab a routine from the File Exchange.

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

답변 (1개)

Walter Roberson
Walter Roberson 2016년 8월 29일

0 개 추천

As Geoff indicates, you are trying to call todatenum with the wrong kind of input object.
If you are trying to convert a double, then you need a different routine. If you are using R2014b or later, you can use datetime objects with 'ConvertFrom', 'posixtime'. If you are using an older release, then you can find unix (posix) time conversion routines in the File Exchange.

카테고리

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

제품

질문:

2016년 8월 29일

댓글:

2016년 8월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by