Comparing Times

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am creating a form which (amoung other things) calculates if an employees
has logged in late.

It compares the actual logged in time with the employees shift start time.
If the logged in time is greater than the shift start time then they are
late. I have this code written and I think its working. I take the current
date, add the shift time and compare to logged in time.

My problem is that one of the shifts starts at 12:00 am.

How can the code figure out if the person logged in on the correct day?

The only solution I can think of is creating a cut off time - I suppose noon
would be best. If you arrive after noon then you are on time, if you arrive
before noon you must be late. ???

Can anyone think of a better solution?
 
12 midnight is stored as a "zero" time. In other words, the date/time value
is the date value with no apparent time.

For example, if a person "punches in" at exactly 12 midnight (between
11:59:59 pm on March 1, 2005 and 12:00:01 am on March 2, 2005), the value
that is stored is
38413.0000000000

If the person "punches in" at 12:00:01 am on March 2, 2005, the value that
is stored is
38413.0000115741

If the person "punches in" at 11:59:59 pm on March 1, 2005, the value that
is stored is
38412.9999884259
 
Back
Top