Get the number of the last day in a month from an YearMonth object

classic Classic list List threaded Threaded
2 messages Options
fed
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Get the number of the last day in a month from an YearMonth object

fed
Hi,

i was looking on javadoc but i found nothing, there is some way to get
the number (as int) of the last day in a month from a YearMonth
object?

for example january -> 31, april -> 30 etc.

For now i am creating an object rappresenting the first day of the
month and then i use dayOfMonth().getMaximumValue(), but maybe there
is something that can
i use directly from YearMonth.

Thanks

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Joda-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/joda-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Get the number of the last day in a month from an YearMonth object

jodastephen
You are right, there is no easy method for this at present.

JSR-310/ThreeTen currently has a lengthInDays() method on the
equivalent class. Feel free to fork GitHub, add a method with that
name with tests, and make a pull request.

Stephen


On 24 April 2012 16:14, fed <[hidden email]> wrote:

> Hi,
>
> i was looking on javadoc but i found nothing, there is some way to get
> the number (as int) of the last day in a month from a YearMonth
> object?
>
> for example january -> 31, april -> 30 etc.
>
> For now i am creating an object rappresenting the first day of the
> month and then i use dayOfMonth().getMaximumValue(), but maybe there
> is something that can
> i use directly from YearMonth.
>
> Thanks
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Joda-interest mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/joda-interest

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Joda-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/joda-interest
Loading...