Compare times in datetimes

4 visualizzazioni (ultimi 30 giorni)
dormant
dormant il 24 Mag 2024
Commentato: Voss il 28 Mag 2024
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.)

Risposta accettata

Voss
Voss il 24 Mag 2024
  2 Commenti
dormant
dormant il 28 Mag 2024
Thanks.
Voss
Voss il 28 Mag 2024
You're welcome!

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Dates and Time in Help Center e File Exchange

Tag

Prodotti


Release

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by