Code covered by the BSD License  

Highlights from
Round off dates and times

4.5

4.5 | 2 ratings Rate this file 50 Downloads (last 30 days) File Size: 5.99 KB File ID: #26374

Round off dates and times

by

 

13 Jan 2010 (Updated )

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

| Watch this File

File Information
Description

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

Acknowledgements

Units.M inspired this file.

MATLAB release MATLAB 7.9 (R2009b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
20 Sep 2013 janez  
26 Jun 2012 Andrea

Nice one, thanks. You can add the possibility of rounding down, up or scientifically by changing the final "round" with floor, ceil or leave it to round (and possibly make the user decide with an argument to the function)

Updates
03 May 2010

Fixed H1 comment line so "lookfor" will work.

Contact us