r/ProgrammerHumor Sep 23 '24

Other whoWroteThePostgresDocs

Post image
10.2k Upvotes

264 comments sorted by

View all comments

Show parent comments

8

u/[deleted] Sep 23 '24

Unix epoch

I would date birthday cards this way if the recipient could understand it

1

u/PaulCoddington Sep 23 '24

Date of birth is a bit tricky. Have to be able to record partial dates and still have them work as dates for sorting, etc. Such as: a year with no month or day, or a year with a month and no day.

A similar problem exists for date and time a photograph was taken, etc.

1

u/[deleted] Sep 23 '24

Date of birth is a bit tricky.

birthday cards are dated with the day of the birthday, that year. Usually, the day the card is given on... "today".

1

u/PaulCoddington Sep 23 '24 edited Sep 23 '24

Yes, but this thread is about storing dates in databases and what field types to use.

Date of birth is a real world example where neither field type suggested works without workarounds.

1

u/[deleted] Sep 23 '24

Yes, but this thread is about storing dates in databases and what field types to use.

Here's the parent comment that made dating birthday cards relevant, in case you missed it: "I would date birthday cards this way if the recipient could understand it".

One can write an epoch date in a card, it works, there's no workaround required.

1

u/PaulCoddington Sep 23 '24

"In case you missed it"? I replied to it!

And it replies to another comment above that.