Round off dates and times

Rounds off a datenum to the nearest second, minute, hour, day, month or year.

You are now following this Submission

Rounds off a datenum to the nearest second, minute, hour, day, month or year. Zip file includes "units.m" (file 4093) by Henning Ressing.

Example: datenum_round_off(now, 'minute')

Cite As

Kevin J. Delaney (2026). Round off dates and times (https://in.mathworks.com/matlabcentral/fileexchange/26374-round-off-dates-and-times), MATLAB Central File Exchange. Retrieved .

Acknowledgements

Inspired by: units.m

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.1.0.0

Fixed H1 comment line so "lookfor" will work.

1.0.0.0