I get error message when converting epoch date to number

8 visualizaciones (últimos 30 días)
Robert Winkel
Robert Winkel el 29 de Ag. de 2016
Comentada: Walter Roberson el 29 de Ag. de 2016
>> 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 comentarios
Robert Winkel
Robert Winkel el 29 de Ag. de 2016
Geoff, thanks, yes that could be true. Do you know how to convert my double (epoch) to the Matlab date?
Walter Roberson
Walter Roberson el 29 de Ag. de 2016
R2014b or later, use datetime objects with 'ConvertFrom', 'posixtime'. Otherwise grab a routine from the File Exchange.

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 29 de Ag. de 2016
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.

Categorías

Más información sobre Dates and Time en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by