4 ms·
There is one thing that I ran into with past times that I think falls outside of this. When you record things like “first day of employment”, you really do mean
by IgorPartola 8y ago
There is one thing that I ran into with past times that I think falls outside of this. When you record things like “first day of employment”, you really do mean the date and not the datetime, and the date should be interpreted in whatever the local timezone is. Theoretically your first datetime if employment is what, midnight of the day you show up? Or is it 8am or whatever when you actually first step through the door? Each situation will be interpreted differently by the parties involved so best you can do is to store the date and the location/timezone of where they work, even though it’s in the past.
- sudhirj 8y agoYeah, a date and datetime / instant are two very different things, but I just renewed an insurance policy, and while it's been all dates on the forms so far the actual policy documents is clear about midnight to midnight on those dates. In the particular case of employment I'd assume there was as implicit time as well, because employment would be a legal contract (whatever the precedent is in that jurisdiction would probably apply). You couldn't do something that's against your contract on the way to work on your first day, for example, and claim that it didn't count because it was before office hours.
- PeterisP 8y agoThe answer to your examples is that the conversion from date to datetime sometimes is ill-defined and you shouldn't assume that this can be properly done. Legally, employment usually has a well defined start date and end date - and it often simply doesn't have a well defined start datetime and an end datetime, you might as well assume that it's undefined unless/until a particular situation forces you to get a court ruling for that.
- IgorPartola 8y agoHow would you for example run payroll then for people who work 4pm-2am? You have to know whether the last two hours of the shift fall into one payroll period or the next, which necessitates that you be able to convert to a datetime.