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.)

 Akzeptierte Antwort

Voss
Voss am 24 Mai 2024

1 Stimme

2 Kommentare

dormant
dormant am 28 Mai 2024
Thanks.
Voss
Voss am 28 Mai 2024
You're welcome!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2024a

Tags

Gefragt:

am 24 Mai 2024

Kommentiert:

am 28 Mai 2024

Community Treasure Hunt

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

Start Hunting!

Translated by