美文网首页
获取当前系统时间是周几

获取当前系统时间是周几

作者: GaoXiaoGao | 来源:发表于2019-03-26 11:57 被阅读0次

    public static StringgetCurrentWeekDay(){

    String[] weekDays = {"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" };

        Calendar cal = Calendar.getInstance();

        cal.setTime(new Date(System.currentTimeMillis()));

        int w = cal.get(Calendar.DAY_OF_WEEK) -1;

        if (w <0)

    w =0;

        return weekDays[w];

    }

    相关文章

      网友评论

          本文标题:获取当前系统时间是周几

          本文链接:https://www.haomeiwen.com/subject/nbkgvqtx.html