Oracle's default date format is YYYY-MM-DD, WHY?

后端 未结 12 2448
温柔的废话
温柔的废话 2020-11-29 00:44

Oracle\'s default date format is YYYY-MM-DD. Which means if I do:

 select some_date from some_table

...I lose the time portion of

12条回答
  •  有刺的猬
    2020-11-29 01:21

    reason: if you are looking at a column of data with a time stamp, the _MOST_IMPORTANT_ bit of information is the year. If data has been in the db for ten years, that's important to know. so year comes first.

    it makes sense that month would come next, then day, hour, minute. Objectively, these are the most logical sequence for time data to be displayed.

    it also makes sense that if you are going to display the data by default, you should display only the most significant portion of the data, so by default, only Y-M-D. everything else CAN be displayed, but it does not clutter your sql report by default.

    Ordering by date is logical if you display Y-M-D because it is sequential. Computers are good at sequential, and it looks logical.

    finally. Your bias to want M-D-Y is your bias. Not everyone even in the US uses this format. So use the most logical format and don't be outraged when others decide to be logical by default.

    (I am US born, and I do not represent Oracle. I can, however, think for myself)

提交回复
热议问题