关于日期: 如何获得当前年, 当前周?

jojo008 2006-02-08 02:03:23
如题
...全文
124 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
fashchina 2006-02-08
  • 打赏
  • 举报
回复
up
Samland 2006-02-08
  • 打赏
  • 举报
回复
import java.util.Calendar;


Calendar c = Calendar.getInstance();

c.get(Calendar.YEAR);
Field number for get and set indicating the year.

c.get(Calendar.WEEK_OF_YEAR);
Field number for get and set indicating the week number within the current year.

c.get(Calendar.WEEK_OF_MONTH);
Field number for get and set indicating the week number within the current month.

62,629

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧