我有一个字符串日期,格式如下:
2020-05-19 10:46:09 this is Asia/Jakarta time
我想将其转换为GMT时间,这是我的代码:
String created = New_tradingHistory_trade.getCreated_at();
Date date1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(created);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
String CreatedGMT = sdf.format(date1);
System.out.print(CreatedGMT);
我收到的一直都是:
2020年5月19日10:46:09,我的问题是如何将我的日期转换为GMT?