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 PMas start time12:00 AMas 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.
Well 12:00 am is on the next day. Options:
You should think about other situations carefully though, e.g.
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.