how to Specify Time Zones?

조회 수: 2 (최근 30일)
pruth
pruth 2019년 12월 6일
편집: pruth 2019년 12월 9일
i have this time array(datetimes-attached). since this is a UTC time i need to convert it into local time that is 4 hr 54 min ahead of UTC.
i am using this code give bellow
TimeZone = ' +4:54', a = datetimes.TimeZone
or even if i use this
datetimes.TimeZone = '+4:54'
it gives me an error saying
'Struct contents reference from a non-struct array object.'
what i am doing wrong here ??
and in this case what i need to do to get rid of this problem ?

답변 (1개)

Bhaskar R
Bhaskar R 2019년 12월 6일
편집: Bhaskar R 2019년 12월 6일
Given mat file contains series date numbers. Instead of taking time zone as '+HH:mm' format specify local area string as 'Asia/Kolkata'
load('datetimes.mat');
t = datetime(datetimes,'ConvertFrom','datenum'); % series to datetime format
t.TimeZone = 'Asia/Kolkata';
  댓글 수: 1
pruth
pruth 2019년 12월 9일
편집: pruth 2019년 12월 9일
in atmopsheric research we can not use kolkatas time for Pune. even in india we we follow same time zone local time varies with longitude! i have to specify time as '+HH:mm' format

댓글을 달려면 로그인하십시오.

카테고리

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