get local time from UTC refered dataset

3 次查看(过去 30 天)
I want to make a daily sum for a local calender day with 3-hourly data in UTC Greenwich time. The filename contain the date and time in this format yyyymmdd.hh To get a Greenwich calender day I have done this (in MATLAB):
C = zeros(8,6,NumOfDates);
for i=1:NumOfDates % number of dates
B = zeros(8,6);
for j = 1:8 % 24h/3h interval, number of hour data within 24 h for 3 hourly measurement
A(j)= xxxxx % not specified here as it is irrelevant for the question
B = B + A(j);
end
C(i)= B;
end
Can I do following to get local time? (here 18 UTC previous day to 18 UTC next day)
C = zeros(8,6,NumOfDates-1); % initialise daily 3h-derived data collection array
for i = 1:NumOfDates-1 % date-lopp
%.....
B = zeros(8,6); % Initialise for every day
for j = 1:4 % hour-loop
hour=0:3:15;
%.....
A(:,:,j)=3*prec(MatrixN:MatrixS,MatrixW:MatrixE); % area extract, 3-hourly to hourly by assuming same
end
B(:,:) = B + A(:,:,j); % sum hourly data into daily for extracted area
end
C(:,:,i)= B; % collect daily 3-h derived values
F = zeros(8,6,NumOfDates-1);
for k = 2:NumOfDates % date-lopp
%.....
B = zeros(8,6); % Initialise for every day
for j = 1:2 % hour-loop
hour=18:3:21;
A(:,:,j)=3*prec(MatrixN:MatrixS,MatrixW:MatrixE); % area extract, 3-hourly to hourly by assuming same rain rate the next 3-h
TimeVector(count,:)=strcat(Datename,hour);
end
B(:,:) = B + A(:,:,j); % sum hourly data into daily for extracted area
end
F(:,:,k)= B; % collect daily 3-h derived values
end
Y = C+F;

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Dates and Time 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by