Clear Filters
Clear Filters

Compare times in datetimes

22 views (last 30 days)
dormant
dormant on 24 May 2024 at 14:35
Commented: Voss on 28 May 2024 at 14:43
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.)

Accepted Answer

Voss
Voss on 24 May 2024 at 14:42
  2 Comments
dormant
dormant on 28 May 2024 at 14:40
Thanks.
Voss
Voss on 28 May 2024 at 14:43
You're welcome!

Sign in to comment.

More Answers (0)

Tags

Products


Release

R2024a

Community Treasure Hunt

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

Start Hunting!