How are MathWorks products affected by the change to Daylight Savings Time in 2007?

2 views (last 30 days)
In 2007, the start and stop dates of Daylight Savings Time (DST) will change for the United States. The Energy Policy Act of 2005 mandates that, starting in 2007, DST will begin on the second Sunday in March and end on the first Sunday in November. In 2007, the beginning and end stop dates will be March 11 and November 4, respectively. These dates are different from previous DST start and stop dates.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
Most MathWorks products do not have any DST issues. However, some MathWorks products do rely on the time reporting functions of the Operating System and Java and will be affected by the DST changes. In addition, since MathWorks products involve use of a programming environment, the impact of the wrong time is also dependent on the programs written and their intent.
In order to patch the Operating System and the Java Virtual Machine (JVM) to correct the issues, see the “Related Solutions” at the bottom of this page.
Read below for more information on the effect of not patching the Operating System or JVM.
Impact of not patching the Operating System:
MATLAB itself will report the current time incorrectly (off by one hour). Thus the entire suite of time-reporting functions in MATLAB such as NOW, DATE and CLOCK will report the incorrect time. Any functions which rely on these for the time will also be affected. The effect could be widespread.
Note that this has no relation to the JVM. Executing MATLAB using:
matlab –nojvm
will still produce time-related inaccuracies in MATLAB running on an unpatched Operating System.
Here are two examples where the effects will be seen:
1. Take a program that extracts stock market prices every minute. If any comparisons of the data are performed that require the local time (from the NOW function), these calculations will be inaccurate.
2. MATLAB file time stamps will be incorrect, as they are dependent on the Operating System returning the correct time/date.
No impact is expected in terms of product license expiration dates.
Impact of not patching the JVM:
Any MATLAB program that relies on the JVM’s time and date features will return an incorrect time from March 11, 2007 through April 2, 2007 and from October 29, 2007 through November 4, 2007.
There are four places where Java’s time-reporting functionality is used. These are:
1. Custom Java classes that use Java's time reporting features
2. Instrument Control Toolbox
3. Timeseries objects
4. Command History timestamps and Current Directory pane filestamps.
If you are using any other toolbox/functionality, those will not be affected by the JVM’s time-keeping systems. Read below for more details:
1. Custom Java classes
Using custom Java classes that utilize Java’s date/time features (such as Java’s Calendar class) will receive times that are off by one hour during the DST period. Using this custom class in MATLAB will produce inaccuracies.
This is equivalent to using the custom Java class outside MATLAB. Thus it is best to test the class outside MATLAB first.
2. Instrument Control Toolbox
The Instrument Control Toolbox uses Java’s timekeeping system when recording events to files. The actual timer events will not be affected.
Examples of events that can have the wrong time recorded or printed in the command window output are BytesAvailable, Error, Output empty, and Timer.
Here are two examples where the discrepancy will be seen:
a. Record files with the times of events, such as the amount of data available, may log the wrong timestamp.
b. The same events will print the time in the MATLAB command window showing the wrong timestamp.
3. MATLAB time series objects
In MATLAB 7.3 (R2006b), the timeseries object will be affected if times are setup using the TSTOOL function or using the Array Editor. This will happen if the time lies in the period between the new and old Daylight Savings Time dates.
4. MATLAB Command History timestamps
The Command History window will log timestamps that are off by an hour.

More Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!