Date and number (hour) to times

3 visualizaciones (últimos 30 días)
Alex
Alex el 21 de Oct. de 2019
Respondida: Ted Shultz el 21 de Oct. de 2019
I have two columns: First - Date (for example, 24-Jun-2015); Second - Hour for that Date (for example, 9, i.e., just a number of the hour). Can somebody tell me how I can convert these two pieces of information into ONE date?
  4 comentarios
Stephan
Stephan el 21 de Oct. de 2019
Editada: Stephan el 21 de Oct. de 2019
please give us data that we can work with instead of screenshots - a .mat-file attached to a comment or your question, will help us to help you...
Alex
Alex el 21 de Oct. de 2019
Of course! Here is the file.

Iniciar sesión para comentar.

Respuestas (1)

Ted Shultz
Ted Shultz el 21 de Oct. de 2019
If you convert the date column to datetime, and the hour column to a duration of hours, then you simply add them together to get a new datetime. This datetime can be converted to anything you like.

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by