Java代码:给定日期告诉我它属于哪个星期 [英] Java code :given date tell me which week it falls into

查看:98
本文介绍了Java代码:给定日期告诉我它属于哪个星期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要有关如何在JAVA中写这个的帮助

我的输入将是一堆日期Ex 1-10-2018,1-15-2018 .. etc

我需要按周分组



我尝试过:



我需要有关如何在JAVA中写这个的帮助

我的输入将是一堆日期Ex 1-10-2018,1-15-2018 .. etc

我需要按周分组它们

I need help on how to write this in JAVA
My input will be bunch of dates Ex 1-10-2018, 1-15-2018 .. etc
I need to group them by week

What I have tried:

I need help on how to write this in JAVA
My input will be bunch of dates Ex 1-10-2018, 1-15-2018 .. etc
I need to group them by week

推荐答案

GregorianCalendar类 [ ^ ]应该这样做(用 WEEK_OF_YEAR get 方法c $ c> field)。
The GregorianCalendar class[^] should do the trick (have a look at the get method with the WEEK_OF_YEAR field).


这篇关于Java代码:给定日期告诉我它属于哪个星期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆