If you add a period of 1 month Joda-Time will adjust the day if
necessary, which handles these cases
Jan 31 -> Feb 28
March 31 -> April 30

However, Joda-Time does not handle these cases, so you'll need manual
logic for 5 of the months:
Feb 28 -> March 31
Apr 30 -> May 31

Stephen


On 6 September 2011 06:28, Todd Nine <t...@spidertracks.com> wrote:
> Hi guys,
>   I'm new to Joda Time.  It's a great API, I'm using it calculate date
> ranges for customers and their data usage.  We define usage periods as "1
> month".
>
> For instance, if a user registers on Jan1, this would be their invoice
> durations
>
> Jan1 -> Feb 1
> Feb1 -> March 1
> March 1 -> April 1
>
> However, when registering towards the end of the month, this becomes tricky
>
> Jan 31 -> Feb 28
> Feb28 -> March 31
> March 31 -> April 30
>
>
> Is there an easy way to calculate this via Joda time?
>
> Thanks,
> Todd
>
> ------------------------------------------------------------------------------
> Special Offer -- Download ArcSight Logger for FREE!
> Finally, a world-class log management solution at an even better
> price-free! And you'll get a free "Love Thy Logs" t-shirt when you
> download Logger. Secure your free ArcSight Logger TODAY!
> http://p.sf.net/sfu/arcsisghtdev2dev
> _______________________________________________
> Joda-interest mailing list
> Joda-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/joda-interest
>
>

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Joda-interest mailing list
Joda-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to