Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5960429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:49:32+00:00 2026-05-22T18:49:32+00:00

Seems like everyone always ignores the time part, but how would you compare two

  • 0

Seems like everyone always ignores the time part, but how would you compare two datetimes ignoring the date? if we just compare them as TIME it seems to still favor the oldest date.

(12/02/2004 9:00) > (12/02/2011 8:24) –this would be true.

The below code works but it feels a bit a bit beating around the bush comparing the hours and minutes separately.

var results = from x in dataContext.GetTable<ScheduleEntity>()                           
              where x.LastRunDate < date.Date 
              && x.reportingTime.Hour <= date.Hour
              && x.reportingTime.Minute <= date.Minute
              && x.reportingFequency.Substring(position, 1) == scheduled
              select x;  

Also, the reason we are doing this is because we couldn’t get our SQL TIME to compare to a TIMESPAN this says it would be the same but LINQ is returning a “TIME to bigint conversion error”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:49:33+00:00Added an answer on May 22, 2026 at 6:49 pm

    DateTime has a TimeOfDay property, you can use this to compare the times for two dates as follows:

    var one = DateTime.Now.AddHours(1);
    var two = DateTime.Now;
    var diff = one.TimeOfDay - two.TimeOfDay;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It seems to me like there's a lot of sheeping going on, with everyone
Seems like there should be... Right now it just seems like magic that you
Seems like this should be obvious, but how do I send arrow key presses
Seems like this should be simple, but powershell is winning another battle with me.
Seems like it would be better if you did commit followed by merge. I'm
Hey everyone, this seems like it should be a simple one; I really hope
hi everyone ive got quite an error here it seems like c++ is not
Sorry if this question seems obvious for everyone, but I am very new to
Seems like everyone have issue accessing local machine or internet etc from emulator. All
Seems like everyone is moving towards IoC containers. I've tried to grok it for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.