How to see the time difference of the same day for different time zones?

조회 수: 2 (최근 30일)
Ekaterina Serikova
Ekaterina Serikova 2016년 7월 21일
댓글: Star Strider 2016년 7월 21일
Hello!
Could anybody help me in time difference issue?
I have a vector of dates with time, char type, like this: "29-Jan-2016 09:00:00". I would like to see time difference for each date-time between Frankfurt and New York, accounting for daylight saving changes. For example, for today "21-Jul-2016 09:00:00" the difference is 6 hours, so I would like to see either "+6" or the time in NY corresponding to 09:00 in Frankfurt, which is "21-Jul-2016 03:00:00". How can I do that for all the dates in MatLab, adjusted for summer and winter times?
Thanks a lot!

답변 (2개)

Star Strider
Star Strider 2016년 7월 21일
The easiest way to do this is with a datetime object (in R2014a and later versions).
  댓글 수: 2
Ekaterina Serikova
Ekaterina Serikova 2016년 7월 21일
Should I specify different time zones and then take the difference?
Star Strider
Star Strider 2016년 7월 21일
I would probably convert them all to UTC and then do the calculations. I’ve not done anything similar to what you’re doing, so you will have to experiment.

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


J. Webster
J. Webster 2016년 7월 21일
also look at tzoffset. Not sure what versions it's in

카테고리

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