4 ms·
Serious question: do people use time_t for representing a date of birth? To me that wouldn't seem right: a date of birth isn't a timestamp and you typically re
by bloak 2y ago
Serious question: do people use time_t for representing a date of birth?
To me that wouldn't seem right: a date of birth isn't a timestamp and you typically receive it without a corresponding place or time zone so there's no reasonable way to convert it into a timestamp.
(The other problem is that a signed 32-bit time_t only goes back to 1901. You might not have to deal with a date of birth before 1901 today, unless you're doing genealogy, of course, but until fairly recently it's something you'd probably want to be able to handle.)
- nomel 2y agoMy birth certificate has location, day, year, hour, and minute of birth. Birth is an event in time, perfectly represented with a (UTC) timestamp.
- Merad 2y agoYour birth is an event that happened at an instant in time, but very few systems concern themselves with that detail. The vast majority need to store birth _date_ and have no interest in the time or location.
- nomel 2y ago> have no interest in the time Setting the bottom couple of bytes to zero achieves this, while maintaining nearly universal consistency with all other events in time that might need to be related with a packing of bits. People do it because it's what's being used at nearly every other level of the stack.
- cryptonector 2y ago> Birth is an event in time, perfectly represented with a (UTC) timestamp. That's not the same thing as `time_t` though. `time_t` is UTC. UTC is not `time_t`.
- School-Cotton 2y ago> Serious question: do people use time_t for representing a date of birth? I have seen people in real life use seconds since the UNIX epoch to represent DOB, yes.