how to Specify Time Zones?

3 Ansichten (letzte 30 Tage)
pruth
pruth am 6 Dez. 2019
Bearbeitet: pruth am 9 Dez. 2019
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 ?

Antworten (1)

Bhaskar R
Bhaskar R am 6 Dez. 2019
Bearbeitet: Bhaskar R am 6 Dez. 2019
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 Kommentar
pruth
pruth am 9 Dez. 2019
Bearbeitet: pruth am 9 Dez. 2019
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

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Dates and Time finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by