![](/profiles/wavemetrics/themes/wavemetrics/logo.png)
Sort By Time Of Day
![](/sites/default/files/styles/thumbnail/public/default_images/Artboard%201_1.png?itok=jeHOCIXy)
![](/profiles/wavemetrics/themes/wavemetrics/images/icons/employee-icon.png)
hrodstein
// Sorts input date/time wave by the time of day. NaNs (blanks) go to the end.
// NOTE: This overwrites the input wave.
Function SortByTimeOfDay(w)
Wave w // Date/time wave to be sorted
Duplicate/FREE w, timeOfDay
timeOfDay = mod(w, 24*60*60) // timeOfDay now contains just time of day
Sort {timeOfDay,w}, w // Sort w by timeOfDay, then by date
End
// NOTE: This overwrites the input wave.
Function SortByTimeOfDay(w)
Wave w // Date/time wave to be sorted
Duplicate/FREE w, timeOfDay
timeOfDay = mod(w, 24*60*60) // timeOfDay now contains just time of day
Sort {timeOfDay,w}, w // Sort w by timeOfDay, then by date
End
![](/sites/default/files/forum.png)
Forum
![](/sites/default/files/support.png)
Support
![](/sites/default/files/gallery.png)
Gallery
Igor Pro 9
Learn More
Igor XOP Toolkit
Learn More
Igor NIDAQ Tools MX
Learn More