I am testing MATLAB to ensure that I am correctly applying its functionality. An example from the a data source includes:
- The current time in UNIX epoch seconds is: 1160967053
- The current time in New York is Sun Oct 15 22:50:53 EDT 2006
I am assuming that the above is correct and attempting to reproduce the result in MATLAB:
dt = datetime( 1160967053, 'ConvertFrom', 'posixtime' )
dt = 16-Oct-2006 02:50:53
This result is +4 hours: I was expecting +5 hours. New York time is UTC -5. There is discrepancy of 1 hour: daylight savings time?
When adding the timezone to the function, the result matches the reference example:
T = datetime(1160967053,'ConvertFrom','posixtime','TimeZone','America/New_York')
T = 15-Oct-2006 22:50:53
- If NYC is UTC -5, why is the difference 4 hours?