LoginSignup
5
6

More than 5 years have passed since last update.

java UTC時間からJST時間に変換

Posted at
            // UTC時間
            SimpleDateFormat utcdatestr = new SimpleDateFormat("yyyyMMddHHmmssSSS");
            utcdatestr.setTimeZone(TimeZone.getTimeZone("UTC"));
            Date utcdate = utcdatestr.parse(dateOrg); 
            // JST時間
            SimpleDateFormat tokyoSdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");  
            tokyoSdf.setTimeZone(TimeZone.getTimeZone("Asia/Tokyo"));
            date = tokyoSdf.format(utcdate);  
5
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6