how to convert (Indian Standard time)IST datetime to UTC ?

14 ビュー (過去 30 日間)
pruth
pruth 2021 年 6 月 22 日
コメント済み: Walter Roberson 2021 年 6 月 22 日
hi,
I have time table with datetime like this
15-Sep-2019 09:30:00
15-Sep-2019 10:00:00
15-Sep-2019 10:30:00
15-Sep-2019 11:00:00
15-Sep-2019 11:30:00
15-Sep-2019 12:00:00
15-Sep-2019 12:30:00
15-Sep-2019 13:00:00
15-Sep-2019 13:30:00
15-Sep-2019 13:31:00
i want this to convert in UTC date time !
how would i do that ?

採用された回答

pruth
pruth 2021 年 6 月 22 日
Time =
15-Sep-2019 09:30:00
15-Sep-2019 10:00:00
15-Sep-2019 10:30:00
15-Sep-2019 11:00:00
15-Sep-2019 11:30:00
15-Sep-2019 12:00:00
15-Sep-2019 12:30:00
15-Sep-2019 13:00:00
15-Sep-2019 13:30:00
15-Sep-2019 13:31:00
T = datetime(Time, 'InputFormat','dd-mm-yyyy HH:mm:ss', 'TimeZone','Asia/Kolkata')
T.TimeZone = 'Asia/Kolkata'
  1 件のコメント
Walter Roberson
Walter Roberson 2021 年 6 月 22 日
You should be assigning UTC to T.TimeZone

サインインしてコメントする。

その他の回答 (1 件)

Chunru
Chunru 2021 年 6 月 22 日
s_ist = '15-Sep-2019 13:31:00'; % datetime string for ist
d_ist = datetime(s_ist, 'TimeZone', '+05:30'); % datetime for ist
d_utc = datetime(d_ist, 'TimeZone', '+00:00') % datetime for utc
d_utc = datetime
15-Sep-2019 08:01:00

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by