How to update leap seconds
21 views (last 30 days)
The current version of MATLAB has a function to give you the leap second information that it is using. E.g.,
[T,vers] = leapseconds
But suppose you have a version of MATLAB that is not up to date with the latest leap second data. E.g., an older version of MATLAB, or maybe a recent version of MATLAB but there is a leap second announced that your version doesn't know about. I know there is a proposal to abolish leap seconds (programmers in multiple s/w packages never could seem to get this coded correctly), but what if there is another leap second announced before they officially become abolished or you have an older version of MATLAB? This link doesn't mention how to update MATLAB for this:
Is there a way for the user to update their version of MATLAB by downloading new files or updating current files or ...?
Peter Perkins on 19 Sep 2023
James, there's no way for customers to update MATLAB with new leap seconds. The IERS data is built into a binary file.
The last leap second was 31-Dec-2016. R2016b came out a bit before that, but was "frozen" before the IERS declared that leap second in July 2016. I can't recall if we posted a patch, but if 16b is the version that matters, I can look to see if there's a patch. I know that many of our large customers validate a particular release and standardize on that for years at a time.
These days, we would incorporate a new leap second via MATLAB Updates. That process began sometime around R2018b, I forget exactly when. But in any case, 18b would have that most recent leap second, and no new ones have been declared, and it's anyone's guess whether or not any new ones will ever be declared (this was my guess).
Walter: "datetime() has more leap-second handling than I expected" Is there any leap-second handling that you were looking for that's not there?
More Answers (1)
the cyclist on 15 Sep 2023
The file leapseconds.m calls a built-in file to get the list of leap seconds, but you can edit that file to add additional ones.
In fact, that file contains (commented-out) instructions on how to add leap seconds by "brute force".