I am working on a piece of code which will allow me to reduce a dataset, and part of this requires converting separate date and time variables into one datenum variable.
I have the time in UTC time and also local time. I want to keep local time (Pacific/Auckland) only, but I want to ensure that this will be correct throughout the year/daylight savings. How do I do this?
I have set the timezone on the local data but from what I can tell, this just labels the data? It doesn't actually change the timezone? (I tried it previously with the UTC time data I have and the data remained the same but the "timezone" changed.)
In my data I have UTC time, UTC date, localtime and localdate variables but I am working with the local data in this example as this is what I am interested in ultimately. I will be working with large sets of data that I want to know the date/time of-this data will always be recorded in this area but will span years. I mention this as I'm not sure if it's preferrable to work with UTC time for this purpose.
So, everything is working right now but I'm not sure if my code is robust to give accurate datenumbers year round?
Thanks in advance!
fid = fopen(fullfile(dd,filename));
dates=datetime(data.LOCALDATE, 'TimeZone', 'Pacific/Auckland',...
dates=datetime(t.dates,'Format', 'y/M/d hh:mm:ss');