Converts any Date to (total number of) seconds.
Much faster than the command "second".
Takes into account leap years.
Accurate day count per month.
Year must be > 1.
Cite As
jasongrig (2026). DateToSec (https://in.mathworks.com/matlabcentral/fileexchange/64197-datetosec), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2016b
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Dates and Time in Help Center and MATLAB Answers
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
