Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

10
  • 1
    Except you would never store this as an integer, at least I've never seen it nor considered it. Commented Sep 25, 2018 at 10:54
  • 5
    @pipe: Believe me, some people would. We maintain a legacy system that stores YYYYMMDD as integers. The design probably originated in some old database system without an explicit date type and was kept for backwards compatibility. It's not pretty. Don't do it. Commented Sep 25, 2018 at 11:19
  • 19
    @pipe it has been my experience in the software industry that whenever a reasonable person would want to say "But you would never do X" there is always at least one counter example Commented Sep 25, 2018 at 13:09
  • 5
    @pipe In data warehousing it's not uncommon to use a yyyymmdd integer as the primary/surrogate key for a table of dates. Commented Sep 25, 2018 at 16:55
  • 4
    @pipe, well, the sequence number of a DNS zone is a 32-bit integer, which must be increased when the zone changes. While it could be just a plain number, a common idiom is to use numbers like 2018092601... Then there are some curious definitions of magic numbers in described in feature_test_macros(7), like having _POSIX_C_SOURCE > 200809L means that features from POSIX.1-2008 are supported... Commented Sep 26, 2018 at 17:56