Compare times in datetimes

How can I compare only the time part of a datetime value?
I have an array of datetimes:
DT.Format = 'yyyy-MM-dd HH:mm:ss';
How can I identify those which fall between 6am and 6pm?
It should be quite easy, but my brain seems to have a massive block on datetime. (I have a lot of scripts that use datenum, and it never seems trivial to update them to datetime.)

 Respuesta aceptada

Voss
Voss el 24 de Mayo de 2024

1 voto

2 comentarios

dormant
dormant el 28 de Mayo de 2024
Thanks.
Voss
Voss el 28 de Mayo de 2024
You're welcome!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Productos

Versión

R2024a

Etiquetas

Preguntada:

el 24 de Mayo de 2024

Comentada:

el 28 de Mayo de 2024

Community Treasure Hunt

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

Start Hunting!

Translated by