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 7725341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:54:47+00:00 2026-06-01T04:54:47+00:00

Here I am explaining the scenario – The user, after providing a service has

  • 0

Here I am explaining the scenario –

The user, after providing a service has to provide input of the start and end time of the service, but it has to be on the same date. Now when s/he tries to give input like

  • 11:45 PM as start time
  • 12:00 AM as end time

where for example date is: 20/03/12 that means this is a 15 minute service.

The user gets some validation message like “start and end date are not in same date”. this is because, whenever s/he is providing 12:00 AM as end date, the system gets that as the starting time of the next day. That’s means:

  • Start time: 11:45 PM – 20/03/12
  • End time: 12:00 AM – 21/03/12

I am looking for a standard solution, how can this type of situation be handled?
FYI, its in a web application written in java.

  • 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-01T04:54:49+00:00Added an answer on June 1, 2026 at 4:54 am

    Well 12:00 am is on the next day. Options:

    • Check whether the inclusive end time is on the same day, by subtracting a millisecond from the exclusive end time, and use that for the check
    • Explicitly check for midnight

    You should think about other situations carefully though, e.g.

    • 0 minutes of service, midnight to midnight on the same day
    • 24 hours of service, midnight to midnight of the next day
    • Attempt at 48 hours of service, midnight to midnight of 2 days later
    • “Reversed” times: midnight today to midnight of the previous day

    It’s also unclear how time zones are going to come into this – bear in mind that in some time zones, midnight won’t even occur on all days due to DST transitions.

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

Sidebar

Related Questions

Having a hard time explaining what I mean, so here is what I want
I will start by explaining my scenario in code: public class A { }
I am having trouble explaining this to myself but here is my best attempt.
I followed the advice here, but I'm still running into the same issues after
This one is a bit tedious in as far as explaining, so here goes.
First, to make my job explaining a bit easier, here's some of my code:
Here's my scenario - I have an SSIS job that depends on another prior
Here is runnable piece of code explaining the problem - I can remove s1
Here in this video at 11th minute, while explaining about strange structure (compared to
I did a poor job of explaining my original question, so here's a second

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.