Timeline for answer to Is there any technical reason why, in programming, the default date format is YYYYMMDD and not something else? by zahbaz
Current License: CC BY-SA 4.0
Post Revisions
12 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Oct 3, 2018 at 3:56 | comment | added | Sir Swears-a-lot | Im a DBA who works with a lot of time series and SCADA data. Storing dates as Integers in YYYYMMDD format in a database is not uncommon, and generally works well. They work especially well when transporting between systems. Biggest downfall is lack of native validation and artihmetic. Proper date formats are better at that. However Ints take less space and sort better, giving them a performance advantage in indexes, sorts and joins. | |
| Sep 27, 2018 at 21:28 | comment | added | mathreadler | This is a pretty good reason to be honest. To choose a representation that gives sensible comparison operators. | |
| Sep 26, 2018 at 17:56 | comment | added | ilkkachu |
@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...
|
|
| Sep 26, 2018 at 8:06 | comment | added | Pieter B | My programming language of choice has nice functionality to work with dates. But because some ... decided to store dates as integers we now also have to support our own library of date functions that work on integer-dates. All those functions are readily available out of the box if only he would have used a date type. | |
| Sep 25, 2018 at 18:14 | comment | added | Guran | Yeah in a DW context it actually makes sense. | |
| Sep 25, 2018 at 16:55 | comment | added | soapygopher | @pipe In data warehousing it's not uncommon to use a yyyymmdd integer as the primary/surrogate key for a table of dates. | |
| Sep 25, 2018 at 16:29 | comment | added | zahbaz | @pipe Good point. By emphasizing integer, I was more trying to draw a connection between YYYYMMDD formatting and mathematical ordering, than assert anything about storage or engineering considerations. | |
| Sep 25, 2018 at 13:09 | comment | added | Joseph Rogers | @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 | |
| Sep 25, 2018 at 11:19 | comment | added | Heinzi | @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. | |
| Sep 25, 2018 at 10:54 | comment | added | pipe | Except you would never store this as an integer, at least I've never seen it nor considered it. | |
| Sep 25, 2018 at 4:35 | review | First posts | |||
| Sep 26, 2018 at 13:59 | |||||
| Sep 25, 2018 at 4:31 | history | answered | zahbaz | CC BY-SA 4.0 |