Java 获取UTC时间

    Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.YEAR,3);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
        System.out.println(sdf.format(calendar.getTime()));

 

posted @ 2020-08-19 14:26  辰梓悦  阅读(720)  评论(0编辑  收藏  举报