calculate if a day of the week exists between two times

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

calculate if a day of the week exists between two times

Michael Crawford
Hi all,

I was wondering if there is a way to check if a day of the week exists between two datetime's

For instance say I have thursday oct 4th 2012 and saturday oct 6th 2012

I want to see if the interval between these 2 dates encompasses a friday.  

I saw how to check if a certain hour of the day exists but not a day of the week.

Or maybe I am going about this wrong.  All ideas welcome

Thanks,
Mike

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
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: calculate if a day of the week exists between two times

jodastephen
There is no special behaviour in Joda-Time to support this. That just
means that its up to you to come up with a good algorithm based on
what Joda-Time does provide.
Stephen

On 6 October 2012 20:39, Michael Crawford <[hidden email]> wrote:

> Hi all,
>
> I was wondering if there is a way to check if a day of the week exists
> between two datetime's
>
> For instance say I have thursday oct 4th 2012 and saturday oct 6th 2012
>
> I want to see if the interval between these 2 dates encompasses a friday.
>
> I saw how to check if a certain hour of the day exists but not a day of the
> week.
>
> Or maybe I am going about this wrong.  All ideas welcome
>
> Thanks,
> Mike
>
> ------------------------------------------------------------------------------
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev
> _______________________________________________
> Joda-interest mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/joda-interest
>

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Joda-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/joda-interest
Loading...