久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Java:獲取當(dāng)前星期幾的值

Java: getting current Day of the Week value(Java:獲取當(dāng)前星期幾的值)
本文介紹了Java:獲取當(dāng)前星期幾的值的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

限時(shí)送ChatGPT賬號(hào)..

目前,我正在創(chuàng)建一個(gè) java 日程安排應(yīng)用程序,我想知道如何在使用 Calendar 類(lèi)獲取一周的第一天時(shí)找到一周中的當(dāng)前日期.

At the moment, I'm creating a java schedule app and I was wondering how to find the current day of the week while using the Calendar class to get the first day of the week.

這是我在課堂上用來(lái)設(shè)置一周時(shí)間表的方法

Here is the method I'm using in a class in order to set up a week schedule

public static String getSunday() {
    SimpleDateFormat d = new SimpleDateFormat(dayDate);
    Calendar specific = cal;
    specific.add(Calendar.DAY_OF_YEAR, (cal.getFirstDayOfWeek() - ??));
    return d.format(specific.getTime());
}

推薦答案

可以通過(guò)Calendar.DAY_OF_WEEK調(diào)用get()獲取當(dāng)前星期幾/p>

You can get the current day of the week by calling get() with Calendar.DAY_OF_WEEK

public int getTodaysDayOfWeek() {
  final Calendar c = Calendar.getInstance();
  return c.get(Calendar.DAY_OF_WEEK);
}

另外,雖然我不確定我是否完全理解您要做什么,但對(duì)我來(lái)說(shuō)它看起來(lái)很可疑.(例如 cal 是什么?)

Also, while I'm not sure I understand exactly what you're trying to do, it looks fishy to me. (What's cal for example?)

這篇關(guān)于Java:獲取當(dāng)前星期幾的值的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Parsing an ISO 8601 string local date-time as if in UTC(解析 ISO 8601 字符串本地日期時(shí)間,就像在 UTC 中一樣)
How to convert Gregorian string to Gregorian Calendar?(如何將公歷字符串轉(zhuǎn)換為公歷?)
Java: What/where are the maximum and minimum values of a GregorianCalendar?(Java:GregorianCalendar 的最大值和最小值是什么/在哪里?)
Calendar to Date conversion for dates before 15 Oct 1582. Gregorian to Julian calendar switch(1582 年 10 月 15 日之前日期的日歷到日期轉(zhuǎn)換.公歷到儒略歷切換)
java Calendar setFirstDayOfWeek not working(java日歷setFirstDayOfWeek不起作用)
The correct way to set and get hour, minutes, sec(設(shè)置和獲取小時(shí)、分鐘、秒的正確方法)
主站蜘蛛池模板: 色综合久久久久 | 国产成人精品久久二区二区91 | www.啪啪.com| 一级毛片视频 | 日本午夜在线视频 | 一级特黄网站 | 国产精品久久久久久久久久不蜜臀 | 91视频在线看 | 欧美日韩久久精品 | 日韩欧美二区 | 亚洲精品日韩一区二区电影 | 中文字幕免费在线观看 | 一区二区三区亚洲 | 国产成人精品a视频 | www.日本国产 | 国产一区二区三区视频 | 综合五月 | 91在线免费视频 | 欧州一区 | 国产盗摄视频 | 日韩在线不卡 | 国产三级一区二区三区 | 成人欧美一区二区 | 亚洲精品乱码 | 一区二区电影网 | 亚洲免费av一区 | 免费av手机在线观看 | 国产成人精品午夜视频免费 | 一区二区三区四区在线视频 | 亚洲精品久久久久久一区二区 | 亚洲福利一区二区 | 久久性av| 亚洲久在线 | 天天拍天天色 | 国产精品美女www爽爽爽 | 国产精品1区2区3区 一区中文字幕 | 久久久久国产精品一区二区 | 特黄毛片 | 狠狠干美女 | 亚洲一区在线日韩在线深爱 | 成人精品一区亚洲午夜久久久 |