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

  • SEARCH
  • Home
  • 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 8696865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:22:12+00:00 2026-06-13T01:22:12+00:00

I try to compare two TimeSpan fields. Code below doesn’t works. Also, I remove

  • 0

I try to compare two TimeSpan fields. Code below doesn’t works. Also, I remove [DataType(DataType.Time)] and try without any success.

    [Required(ErrorMessage = "Required start time")]
    [DataType(DataType.Time)]
    [Compare("EndTime", ErrorMessage = "Početak i kraj smjene moraju biti različiti.")]
    public System.TimeSpan StartTime { get; set; }

    [Required(ErrorMessage = "Required end time")]
    [DataType(DataType.Time)]
    public System.TimeSpan EndTime { get; set; }

How to compare two TimeSpan fields?

  • 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-06-13T01:22:15+00:00Added an answer on June 13, 2026 at 1:22 am

    Compare validates the values are the same. are you sure you want the start and end times to be the same value? also how are the values set? it may be that they are off by a millisecond or two and therefore not equal.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to compare two NSDate objects. But it fails all the time and
i try to compare two class comp1,comp2 i used method below: ComparerCollection(array_X, array_Y); but
i try to compare two lists with each other: ListA (a1,a2,a3,...) ListB (b1,b2,b3,...) I
The Microsoft C compiler warns when you try to compare two variables, and one
I try to compare two arrays. First array is from my csv file and
How do I compare two objects of a custom class in Objective-C? I try
I am trying to compare two dates which are in Finnish time form like
I have a problem when I try to compare two large files. What I
I am getting error of invalid arguments when I try to compare two lists
I am trying to compare two Document objects and try to make operation according

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.