i want all months last 30 days. Can i achieve this with java.util.Date or java.util.Calendar in java?. Thanks
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s certainly got nothing to do with
java.util.Date, which doesn’t really “know” about months (aside from deprecated APIs).You’d have to create your own implementation of
Calendar. Good luck with that – it won’t be fun.Alternatively, you could use Joda Time which is a much nicer date/time API anyway. The
CopticChronologynearly does what you want, except it adds a thirteenth month with 5 or 6 days. I suspect you could fairly easily use that as the basis for a “just 12 months of 30 days” chronology though.